Skip to content

Commit 6199d19

Browse files
robalfordPythonCHB
authored andcommitted
Basic Python module fixes (UWPCE-PythonCert#97)
* Fix typo and code block formatting for in-place assignment section * Fix typo
1 parent 8b8e9ec commit 6199d19

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

source/modules/BasicPython.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,20 +342,20 @@ Example with an immutable type:
342342
In [15]: b
343343
Out[15]: 5 # b is not.
344344
345-
Example with an immutable type:
345+
Example with a mutable type:
346346

347347
.. code-block:: ipython
348348
349-
In [16]: a = [1, 2, 3] # a is a mutable list
349+
In [16]: a = [1, 2, 3] # a is a mutable list
350350
351-
In [17]: b = a # b is now another name for the same list
351+
In [17]: b = a # b is now another name for the same list
352352
353-
In [18]: a += [4, 5, 6] # in-place add more to a
353+
In [18]: a += [4, 5, 6] # in-place add more to a
354354
355-
In [19]: b
356-
Out[19]: [1, 2, 3, 4, 5, 6]
355+
In [19]: b
356+
Out[19]: [1, 2, 3, 4, 5, 6]
357357
358-
In [20]: # b is changed --it's the SAME list.
358+
In [20]: # b is changed --it's the SAME list.
359359
360360
361361
Multiple Assignment
@@ -765,7 +765,7 @@ Functions allow you to take code that would otherwise be duplicated potentially
765765

766766
This is often referred to as "DRY" -- "Don't Repeat Yourself".
767767

768-
It also helps to keep the code clean and maintainable, as there is only one place to make a change. This in trun helps reduce defects.
768+
It also helps to keep the code clean and maintainable, as there is only one place to make a change. This in turn helps reduce defects.
769769

770770
Functions can take and return information.
771771

0 commit comments

Comments
 (0)