@@ -194,11 +194,10 @@ Comments are denoted by `#` and extend to the end of the line.
194194
195195### Variables
196196
197- A variable is a name for a value.
198-
199- You can use letters (lower and upper-case) from a to z. As well as the character underscore ` _ ` .
200-
201- Numbers can also be part of the name of a variable, except as the first character.
197+ A variable is a name for a value. You can use letters (lower and
198+ upper-case) from a to z. As well as the character underscore ` _ ` .
199+ Numbers can also be part of the name of a variable, except as the
200+ first character.
202201
203202``` python
204203height = 442 # valid
@@ -221,7 +220,6 @@ height = 'Really tall' # A string
221220### Case Sensitivity
222221
223222Python is case sensitive. Upper and lower-case letters are considered different letters.
224-
225223These are all different variables:
226224
227225``` python
@@ -240,7 +238,6 @@ WHILE x < 0: # ERROR
240238### Looping
241239
242240Looping is a way to execute a set of instructions any number of times.
243-
244241There are many ways to accomplish this in Python, one of them is the ` while ` statement:
245242
246243``` python
@@ -257,7 +254,6 @@ The statements below the `while` will execute as long as the expression after th
257254### Indentation
258255
259256Indentation in Python is used to denote a set of statements that go together.
260-
261257From our previous example:
262258
263259``` python
@@ -277,25 +273,15 @@ The indentation means that the following statements go together under the `while
277273 num_bills = num_bills * 2
278274```
279275
280- Because the next statement is not indented, it means that it does not belong to the previous set.
281-
282- ``` python
283- print (' Number of days' , days)
284- ```
285-
286- The empty line is just for readability. It does not affect the execution.
287-
288- ### Blocks
289-
290- A block is a set of statements grouped together.
276+ Because the next statement is not indented, it means that it does not
277+ belong to the previous set. The empty line is just for
278+ readability. It does not affect the execution.
291279
292- In our previous example, the statements within the ` while ` form a * block * .
280+ ### Indentation best practices
293281
294- ``` python
295- print (day, num_bills, num_bills * bill_thickness)
296- day = day + 1
297- num_bills = num_bills * 2
298- ```
282+ * Use spaces instead of tabs.
283+ * Use 4 spaces per level.
284+ * Use a Python-aware editor.
299285
300286Indentation within the block must be consistent.
301287
@@ -306,28 +292,17 @@ while num_bills * bill_thickness < sears_height:
306292 num_bills = num_bills * 2
307293```
308294
309- The character colon ` : ` indicates the start of a block and must be present.
310-
311- ``` python
312- while num_bills * bill_thickness < sears_height:
313- ```
314-
315- ### Indentation best practices
316-
317- * Use spaces instead of tabs.
318- * Use 4 spaces per level.
319- * Use a Python-aware editor.
320295
321296### Conditionals
322297
323298The ` if ` statement is used to execute a conditional:
324299
325300``` python
326301if a > b:
327- # `a` is greater than `b`
302+ # a is greater than b
328303 print (' Computer says no' )
329304else :
330- # `a` is lower or equal to `b`
305+ # a is lower or equal to b
331306 print (' Computer says yes' )
332307```
333308
@@ -337,13 +312,13 @@ You can check for multiple conditions with the `elif`.
337312
338313``` python
339314if a > b:
340- # `a` is greater than `b`
315+ # a is greater than b
341316 print (' Computer says no' )
342317elif a == b:
343- # `a` is equal to `b`
318+ # a is equal to b
344319 print (' Computer says yes' )
345320else :
346- # `a` is lower to `b`
321+ # a is lower to b
347322 print (' Computer says maybe' )
348323```
349324
@@ -406,16 +381,12 @@ print('Your name is', name)
406381```
407382
408383` input ` prints a prompt to the user and returns the response.
409-
410384This is useful for small programs, learning exercises or simple debugging.
411-
412385It is not widely used for real programs.
413386
414387### ` pass ` statement
415388
416- Sometimes you need to specify an empty block.
417-
418- The keyword ` pass ` is used for it.
389+ Sometimes you need to specify an empty block. The keyword ` pass ` is used for it.
419390
420391``` python
421392if a > b:
@@ -426,7 +397,7 @@ else:
426397
427398This is also called a "no-op" statement. It does nothing. It serves as a placeholder for statements. Possibly to be added later.
428399
429- ## Exercises 1.2
400+ ## Exercises
430401
431402### (a) The Bouncing Ball
432403
0 commit comments