@@ -10,7 +10,7 @@ making.
1010
1111Python allows us to store data in something called variables so that we are
1212able to use this data at a later point. To place an item in a variable we give
13- it a name then set its value.
13+ it a name then set its value.
1414
1515Now in the REPL type:
1616
@@ -34,7 +34,7 @@ Now in the REPL type the following:
3434 >>> costs = 200
3535 >>> profit = revenue - costs
3636
37- Now type ` profit ` to see the results of this calculation.
37+ Now type ` profit ` to see the results of this calculation.
3838
3939Now work out the cost of running a codebar workshop if 60 people turned up and
4040pizza cost £8 per 2 people?
@@ -45,7 +45,7 @@ could go into this calculation?
4545## Storing text in variables
4646
4747As well as numbers variables are able to store text, known in Python as
48- strings.
48+ strings.
4949
5050Now in the REPL type:
5151
7979Python is what's called a "typed language". This is to say that there are
8080multiple * types* of objects that you work with in Python, and they don't all
8181act the same way. The three types you've learnt so far are * integers* (` int ` ),
82- * floats* (` float ` ), and * strings* (` str ` ). Integers are whole numbers, floats
83- are numbers with a decimal point, and strings are any number of characters
84- surrounded by either "" or ''. This is important to know because every Python
82+ * floats* (` float ` ), and * strings* (` str ` ). Integers are whole numbers, floats
83+ are numbers with a decimal point, and strings are any number of characters
84+ surrounded by either "" or ''. This is important to know because every Python
8585programmer has tried to do this at least once in their career:
8686
8787 "7" + 8
@@ -119,9 +119,9 @@ of these for the final part of this tutorial.
119119## Storing user input in variables
120120
121121Now we are going to look at capturing user input using the python input
122- command. Let's create a variable in which to store the user input.
122+ command. Let's create a variable in which to store the user input.
123123
124- Now type this into your REPL:
124+ Now type this into your REPL:
125125
126126 >>> lucky_number = input("What is your lucky number? ")
127127
@@ -138,7 +138,7 @@ Now try:
138138 >>> my_name = input("What is your name? ")
139139 >>> greeting = "Hello " + my_name
140140
141- Then type ` greeting ` into your REPL to receive your message.
141+ Then type ` greeting ` into your REPL to receive your message.
142142
143143## Decision making using variables
144144
@@ -147,7 +147,8 @@ around with decision making and changing prints based on your answer. In Python
147147(and many other languages), one of the most common ways in which this is done
148148is using an ` if ` statement. For example:
149149
150- >>> if number > 3:
150+ >>> number = 4
151+ ... if number > 3:
151152 ... print("Bigger than three")
152153 ... elif number < 3:
153154 ... print("Smaller than three")
@@ -170,7 +171,7 @@ Let's create a variable called `coffee` and put your coffee cup total into it:
170171 >>> coffee = input("How many cups of coffee have you consumed today? ")
171172
172173Now we'll use some simple if/else logic to decide what to say about your
173- drinking habits:
174+ drinking habits:
174175
175176 >>> if int(coffee) > 4:
176177 ... print("You have a coffee problem")
0 commit comments