Skip to content

Commit 440a8a2

Browse files
authored
Fix minor inconsistencies in introduction.md
- Update output to be consistent with the Python interactive-interpreter (e.g. print() prints its argument string without quotes). - Replace "Python terminal" with "Python shell" for accuracy. While informally acceptable, they are technically different (a shell runs inside a terminal). - Change parenthesis to plural form: parentheses - Replace "return expression" with "return statement" for accuracy.
1 parent 1416f46 commit 440a8a2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

exercises/concept/guidos-gorgeous-lasagna/.docs/introduction.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ A name can be reassigned (or re-bound) to different values (different object typ
4848
>>> print(type(my_first_variable))
4949
<class 'str'>
5050

51+
>>> my_first_variable = 'You can call me "str".' #<-- Strings can be declared using single or double quote marks.
5152
>>> print(my_first_variable)
52-
"Now, I'm a string." #<-- Strings can be declared using single or double quote marks.
53+
You can call me "str".
5354
```
5455

5556

@@ -63,7 +64,7 @@ Using `SCREAMING_SNAKE_CASE` signals that the name should not be re-assigned, or
6364
## Functions
6465

6566
The `def` keyword begins a [function definition][function definition].
66-
Each function can have zero or more formal [parameters][parameters] in `()` parenthesis, followed by a `:` colon.
67+
Each function can have zero or more formal [parameters][parameters] in `()` parentheses, followed by a `:` colon.
6768
Statements for the _body_ of the function begin on the line following `def` and must be _indented in a block_.
6869

6970

@@ -99,7 +100,7 @@ Functions _explicitly_ return a value or object via the [`return`][return] keywo
99100
return number_one + number_two
100101

101102

102-
# Calling the function in the Python terminal returns the sum of the numbers.
103+
# Calling the function in the Python shell returns the sum of the numbers.
103104
>>> add_two_numbers(3, 4)
104105
7
105106

@@ -111,7 +112,7 @@ Functions _explicitly_ return a value or object via the [`return`][return] keywo
111112
```
112113

113114

114-
Functions that do not have an _explicit_ `return` expression will _implicitly_ return the [`None`][none] object.
115+
Functions that do not have an _explicit_ `return` statement will _implicitly_ return the [`None`][none] object.
115116
This means that if you do not use `return` in a function, Python will return the `None` object for you.
116117
The details of `None` will be covered in a later exercise.
117118
For the purposes of this exercise and explanation, `None` is a placeholder that represents nothing, or null:
@@ -123,7 +124,7 @@ def add_two_numbers(number_one, number_two):
123124
result = number_one + number_two
124125

125126

126-
# Calling the function in the Python terminal appears
127+
# Calling the function in the Python shell appears
127128
# to not return anything at all.
128129
>>> add_two_numbers(5, 7)
129130
>>>
@@ -167,8 +168,8 @@ TypeError: number_to_the_power_of() missing 1 required positional argument: 'num
167168

168169
# Calling methods or functions in classes and modules.
169170
>>> start_text = "my silly sentence for examples."
170-
>>> str.upper(start_text) # Calling the upper() method for the built-in str class.
171-
"MY SILLY SENTENCE FOR EXAMPLES."
171+
>>> str.upper(start_text) # Calling the upper() method from the built-in str class.
172+
'MY SILLY SENTENCE FOR EXAMPLES.'
172173

173174
# Importing the math module
174175
import math

0 commit comments

Comments
 (0)