Skip to content

Commit

Permalink
Ensure shorter teaching cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Jan 19, 2024
1 parent aabcef5 commit 29dc406
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 36 deletions.
4 changes: 2 additions & 2 deletions docs/morning_session/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ This module introduces the fundamentals of Python programming language.
|---------------|-------------------------------|
| 09:00-10:00 | [Using the Python interpreter](using_the_python_interpreter.md), [the way of the program](the_way_of_the_program.md) |
| 10:00-10:15 | Break |
| 10:15-11:00 | [Working with Python scripts](working_with_python_scripts.md), [Variables, expressions and statements: variables](variables_expressions_and_statements.md) |
| 10:15-11:00 | [Working with Python scripts](working_with_python_scripts.md), [Variables, expressions and statements: variables](variables_expressions_and_statements_1.md) |
| 11:00-11:15 | Break |
| 11:15-12:00 | [Variables, expressions and statements: operators](variables_expressions_and_statements.md), [Variables, expressions and statements: user input](variables_expressions_and_statements.md)
| 11:15-12:00 | [Variables, expressions and statements: operators](variables_expressions_and_statements_2.md), [Variables, expressions and statements: user input](variables_expressions_and_statements_3.md)

Link to shared document: <https://hackmd.io/@dianai/uppmax-intro/>

Expand Down
151 changes: 151 additions & 0 deletions docs/morning_session/variables_expressions_and_statements_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Variables, expressions and statements: variables

!!!- info "Learning objectives"

* Get the type of an object
* Create a variable
* Use a variable
* Practice converting an equation to Python code

???- question "For teachers"

Teaching goals are:

* Learners have worked with variables
* Learners understand the purpose of variables
* Learners have obtained the data type of a variable
* Learners have heard about what a data type is
* Learners have practiced convert an equation and a text question to Python

Lesson plan:

Exercise 1:

* 5 mins: prior knowledge
* 5 mins: presentation
* 15 mins: challenge
* 5 mins: feedback

Exercise 2 and 3:

* 5 mins: prior knowledge
* 5 mins: presentation
* 15 mins: challenge
* 5 mins: feedback

Exercise 4:

* 5 mins: prior knowledge
* 5 mins: presentation
* 15 mins: challenge
* 5 mins: feedback

## Overview

In any non-trivial calculation, we want to let our computer remember
things, such as the content of a data file, or the parameters/settings
we use in our program. Variables allows one to make a computer
store ('remember') information. Here we use our first simple variables.

Also we practice converting an equation and a mathematical problem
to Python code. We will discover the helpful modulo operator.

```mermaid
flowchart TD
python[[Python]]
%% Give a white background to all nodes, instead of a transparent one
classDef node fill:#fff,color:#000,stroke:#000
subgraph sub_programming_language[Programming language]
interpreted_language[Interpreted language]
programming_language[Programming language]
scripting_language[Scripting language]
interpreter[Interpreter]
scripts[Scripts]
text_files[Text files]
end
style sub_programming_language fill:#ccf,color:#000,stroke:#fcc
subgraph sub_programming_terms[Programming terms]
user_input[User input]
%% file_io[File I/O]
%% command_line_arguments[Command-line arguments]
variables[Variables]
operators[Operators]
%% functions[Functions]
python_packages[Python packages]
%% graphics[Graphics]
end
style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc
subgraph sub_uppmax[UPPMAX]
uppmax[UPPMAX]
uppmax_modules[UPPMAX modules]
uppmax_clusters[UPPMAX clusters]
text_editors[Text editors]
x_forwarding[X-forwarding]
remote_desktop[Remote desktop]
end
style sub_uppmax fill:#fcc,color:#000,stroke:#fcc
python --> |is a| programming_language
python --> |is a| interpreted_language
python --> |is a| scripting_language
programming_language --> |uses| text_files
interpreted_language --> |has a| interpreter
scripting_language --> |is|interpreted_language
scripting_language --> |runs| scripts
scripts --> |are| text_files
%% scripts --> |can use| command_line_arguments
python --> |has| python_packages
python --> |has| variables
%%python --> |has| functions
python --> |has| operators
%%functions --> |use| variables
operators --> |work on| variables
%%python_packages --> |allow| graphics
python_packages --> |allow to use| user_input
%% python_packages --> |allow to do| file_io
%% python_packages --> |allow to use| command_line_arguments
uppmax --> |has| uppmax_clusters
uppmax_clusters --> |have| uppmax_modules
uppmax_clusters --> |have| text_editors
uppmax_clusters --> |allow| x_forwarding
uppmax_clusters --> |has| remote_desktop
uppmax_modules --> |allow the use of| python_packages
uppmax_modules --> |allow the use of| interpreter
text_editors --> |work on|text_files
%%x_forwarding --> |allows|graphics
%%remote_desktop --> |allows|graphics
variables ~~~ uppmax
```


## Exercises

### Exercise 1: working with variables

!!!- info "Learning objectives"

- get the type of an object
- create a variable
- use a variable

Read the following sections of [How to Think Like a Computer Scientist: Learning with Python 3](https://openbookproject.net/thinkcs/python/english3e/index.html):

- 2.1. Values and data types
- 2.2. Variables
- 2.3. Variable names and keywords

Then in section 2.14, do exercises 1 to and including 4.

## Links

* [How to Think Like a Computer Scientist: Learning with Python 3](https://openbookproject.net/thinkcs/python/english3e/index.html)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Variables, expressions and statements
# Variables, expressions and statements: operators

!!!- info "Learning objectives"

Expand All @@ -9,8 +9,6 @@
* Find and use the operator for exponentiation
* Practice the modulo operator
* Practice converting a simple text question to Python code
* Learn how to ask a user for input
* Use input in a calculation

???- question "For teachers"

Expand All @@ -23,7 +21,6 @@
* Learners have practiced convert an equation and a text question to Python
* Learners have read on operators
* Learners have worked with the modulo operator
* Learners have written code that asked for user input

Lesson plan:

Expand Down Expand Up @@ -138,22 +135,6 @@ flowchart TD

## Exercises

### Exercise 1: working with variables

!!!- info "Learning objectives"

- get the type of an object
- create a variable
- use a variable

Read the following sections of [How to Think Like a Computer Scientist: Learning with Python 3](https://openbookproject.net/thinkcs/python/english3e/index.html):

- 2.1. Values and data types
- 2.2. Variables
- 2.3. Variable names and keywords

Then in section 2.14, do exercises 1 to and including 4.

### Exercise 2: an equation with exponentiation

!!!- info "Learning objectives"
Expand Down Expand Up @@ -187,19 +168,6 @@ Read the following sections of [How to Think Like a Computer Scientist: Learning

Then in section 2.14, do exercises 5 and 6.

### Exercise 4: input

!!!- info "Learning objectives"

- learn how to ask a user for input
- use input in a calculation

Read the following section of [How to Think Like a Computer Scientist: Learning with Python 3](https://openbookproject.net/thinkcs/python/english3e/index.html):

- 2.10. Input

Then in section 2.14, do exercise 7.

## Links

* [How to Think Like a Computer Scientist: Learning with Python 3](https://openbookproject.net/thinkcs/python/english3e/index.html)
156 changes: 156 additions & 0 deletions docs/morning_session/variables_expressions_and_statements_3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Variables, expressions and statements: user input

!!!- info "Learning objectives"

* Get the type of an object
* Create a variable
* Use a variable
* Practice converting an equation to Python code
* Find and use the operator for exponentiation
* Practice the modulo operator
* Practice converting a simple text question to Python code
* Learn how to ask a user for input
* Use input in a calculation

???- question "For teachers"

Teaching goals are:

* Learners have worked with variables
* Learners understand the purpose of variables
* Learners have obtained the data type of a variable
* Learners have heard about what a data type is
* Learners have practiced convert an equation and a text question to Python
* Learners have read on operators
* Learners have worked with the modulo operator
* Learners have written code that asked for user input

Lesson plan:

Exercise 1:

* 5 mins: prior knowledge
* 5 mins: presentation
* 15 mins: challenge
* 5 mins: feedback

Exercise 2 and 3:

* 5 mins: prior knowledge
* 5 mins: presentation
* 15 mins: challenge
* 5 mins: feedback

Exercise 4:

* 5 mins: prior knowledge
* 5 mins: presentation
* 15 mins: challenge
* 5 mins: feedback

## Overview

In any non-trivial calculation, we want to let our computer remember
things, such as the content of a data file, or the parameters/settings
we use in our program. Variables allows one to make a computer
store ('remember') information. Here we use our first simple variables.

Also we practice converting an equation and a mathematical problem
to Python code. We will discover the helpful modulo operator.

```mermaid
flowchart TD
python[[Python]]
%% Give a white background to all nodes, instead of a transparent one
classDef node fill:#fff,color:#000,stroke:#000
subgraph sub_programming_language[Programming language]
interpreted_language[Interpreted language]
programming_language[Programming language]
scripting_language[Scripting language]
interpreter[Interpreter]
scripts[Scripts]
text_files[Text files]
end
style sub_programming_language fill:#ccf,color:#000,stroke:#fcc
subgraph sub_programming_terms[Programming terms]
user_input[User input]
%% file_io[File I/O]
%% command_line_arguments[Command-line arguments]
variables[Variables]
operators[Operators]
%% functions[Functions]
python_packages[Python packages]
%% graphics[Graphics]
end
style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc
subgraph sub_uppmax[UPPMAX]
uppmax[UPPMAX]
uppmax_modules[UPPMAX modules]
uppmax_clusters[UPPMAX clusters]
text_editors[Text editors]
x_forwarding[X-forwarding]
remote_desktop[Remote desktop]
end
style sub_uppmax fill:#fcc,color:#000,stroke:#fcc
python --> |is a| programming_language
python --> |is a| interpreted_language
python --> |is a| scripting_language
programming_language --> |uses| text_files
interpreted_language --> |has a| interpreter
scripting_language --> |is|interpreted_language
scripting_language --> |runs| scripts
scripts --> |are| text_files
%% scripts --> |can use| command_line_arguments
python --> |has| python_packages
python --> |has| variables
%%python --> |has| functions
python --> |has| operators
%%functions --> |use| variables
operators --> |work on| variables
%%python_packages --> |allow| graphics
python_packages --> |allow to use| user_input
%% python_packages --> |allow to do| file_io
%% python_packages --> |allow to use| command_line_arguments
uppmax --> |has| uppmax_clusters
uppmax_clusters --> |have| uppmax_modules
uppmax_clusters --> |have| text_editors
uppmax_clusters --> |allow| x_forwarding
uppmax_clusters --> |has| remote_desktop
uppmax_modules --> |allow the use of| python_packages
uppmax_modules --> |allow the use of| interpreter
text_editors --> |work on|text_files
%%x_forwarding --> |allows|graphics
%%remote_desktop --> |allows|graphics
variables ~~~ uppmax
```


## Exercises

### Exercise 4: input

!!!- info "Learning objectives"

- learn how to ask a user for input
- use input in a calculation

Read the following section of [How to Think Like a Computer Scientist: Learning with Python 3](https://openbookproject.net/thinkcs/python/english3e/index.html):

- 2.10. Input

Then in section 2.14, do exercise 7.

## Links

* [How to Think Like a Computer Scientist: Learning with Python 3](https://openbookproject.net/thinkcs/python/english3e/index.html)
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ nav:
- Using The Python interpreter: morning_session/using_the_python_interpreter.md
- The Way Of The Program: morning_session/the_way_of_the_program.md
- Working with Python scripts: morning_session/working_with_python_scripts.md
- Variables, expressions and statements: morning_session/variables_expressions_and_statements.md
- Variables, expressions and statements, variables: morning_session/variables_expressions_and_statements_1.md
- Variables, expressions and statements, operators: morning_session/variables_expressions_and_statements_2.md
- Variables, expressions and statements, user input: morning_session/variables_expressions_and_statements_3.md
# - Lecture: morning_session/lecture.md
# - Exercise: morning_session/exercise.md
- Afternoon Session:
Expand Down

0 comments on commit 29dc406

Please sign in to comment.