Skip to content

Commit b8325af

Browse files
committed
Ran prittier and corrected some spelling errors.
1 parent 40894b6 commit b8325af

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- [The Python Tutorial][the python tutorial] can be a great introduction.
66
- [Numbers][numbers] in Python can be integers, floats, or complex.
7-
- [PEP 8][PEP8] is the Python code style guide.
7+
- [PEP 8][pep8] is the Python code style guide.
88

99
## 1. Define expected bake time in minutes
1010

@@ -32,15 +32,15 @@
3232

3333
## 5. Update the recipe with notes
3434

35-
- Clearly [commenting][comments] and [documenting][docstrings] your code according to [PEP257][PEP257] is always recommended.
35+
- Clearly [commenting][comments] and [documenting][docstrings] your code according to [PEP257][pep257] is always recommended.
3636

37-
[PEP257]: https://www.python.org/dev/peps/pep-0257/
3837
[assignment]: https://docs.python.org/3/reference/simple_stmts.html#grammar-token-assignment-stmt
3938
[comments]: https://realpython.com/python-comments-guide/
4039
[defining functions]: https://docs.python.org/3/tutorial/controlflow.html#defining-functions
4140
[docstrings]: https://docs.python.org/3/tutorial/controlflow.html#tut-docstrings
4241
[naming]: https://realpython.com/python-variables/
4342
[numbers]: https://docs.python.org/3/tutorial/introduction.html#numbers
43+
[pep257]: https://www.python.org/dev/peps/pep-0257/
4444
[python as a calculator]: https://docs.python.org/3/tutorial/introduction.html#using-python-as-a-calculator
4545
[return]: https://docs.python.org/3/reference/simple_stmts.html#return
4646
[the python tutorial]: https://docs.python.org/3/tutorial/introduction.html

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def elapsed_time_in_minutes(number_of_layers, elapsed_bake_time):
5656
"""
5757
Return elapsed cooking time.
5858
59-
This function takes two numbers representing the number of layers & the time already spent
59+
This function takes two numbers representing the number of layers & the time already spent
6060
baking and calculates the total elapsed minutes spent cooking the lasagna.
6161
"""
6262
```

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

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@
22

33
Python is a [dynamic and strongly][dynamic typing in python] typed [object-oriented][object oriented programming] programming language.
44
It employs both [duck typing][duck typing] and [gradual typing][gradual typing], via [type hints][type hints].
5-
Python supports Imperative, declarative (e.g. functional), and object oriented programming _styles_, but internally [everything in Python is an object][everythings an object].
6-
7-
This exercise introduces 4 major Python language features: Names (_variables and constants_), Functions (_and the return keyword_), Comments, and Docstrings.
5+
Python supports Imperative, declarative (e.g., functional), and object-oriented programming _styles_, but internally [everything in Python is an object][everythings an object].
86

7+
This exercise introduces 4 major Python language features: Names (_variables and constants_), Functions (_and the return keyword_), Comments, and Docstrings.
98

109
~~~~exercism/note
1110
1211
In general, content, tests, and analyzer tooling for the Python track follow the style conventions outlined in [PEP 8](https://www.python.org/dev/peps/pep-0008/) and [PEP 257](https://www.python.org/dev/peps/pep-0257/) for Python code style, with the additional (strong) suggestion that there be no single letter variable names.
1312
1413
~~~~
1514

16-
1715
## Name Assignment and Re-assignment
1816

19-
2017
There are no keywords in Python to define variables or constants and there is no difference in the way Python treats them.
2118
Both are considered [_names_][facts-and-myths-about-python-names] that help programmers reference values (_objects_) in a program and are written differently only by convention.
2219
On Exercism, [variables][variables] are always written in [`snake_case`][snake case], and _constants_ in `SCREAMING_SNAKE_CASE`.
@@ -47,14 +44,12 @@ For example, `my_first_variable` can be assigned and re-assigned many times usin
4744
"Now, I'm a string."
4845
```
4946

50-
5147
### Constants
5248

5349
Constants are typically defined at a [module][module] level, being values that are accessible outside function or class scope.
5450
Constant names **_can be reassigned to new values_**, but they are _intended_ to be named only once.
5551
Using `SCREAMING_SNAKE_CASE` warns other programmers that these names should not be mutated or reassigned.
5652

57-
5853
```python
5954
# All caps signal that this is intended as a constant.
6055
MY_FIRST_CONSTANT = 16
@@ -64,25 +59,24 @@ MY_FIRST_CONSTANT = 16
6459
# Please don't: MY_FIRST_CONSTANT = "Some other value"
6560
```
6661

67-
6862
## Functions
6963

7064
The keyword `def` begins a [function definition][function definition].
7165
It must be followed by the function name and a parenthesized list of zero or more formal [parameters][parameters].
72-
Parameters can be of several different varieties, and can even [vary][more on functions] in length.
66+
Parameters can be of several different varieties, and can even [vary][more on functions] in length.
7367
The `def` line is terminated with a colon.
7468

7569
```python
7670
# function definition
7771
def my_function_name(parameter, second_parameter):
7872
<function body>
79-
73+
8074
```
8175

76+
8277
Statements for the _body_ of the function begin on the line following `def` and must be _indented in a block_.
8378
There is no strict indentation amount (_either space **OR** [tab] characters are acceptable_), but [indentation][indentation] must be _consistent for all indented statements_.
8479

85-
8680
```python
8781
# Function definition on first line.
8882
def add_two_numbers(number_one, number_two):
@@ -92,6 +86,7 @@ def add_two_numbers(number_one, number_two):
9286
7
9387
```
9488

89+
9590
Functions explicitly return a value or object via the [`return`][return] keyword.
9691

9792
```python
@@ -103,6 +98,7 @@ def add_two_numbers(number_one, number_two):
10398
7
10499
```
105100

101+
106102
Functions that do not have an explicit `return` expression will return [`None`][none].
107103

108104
```python
@@ -114,6 +110,7 @@ def add_two_numbers(number_one, number_two):
114110
None
115111
```
116112

113+
117114
While you may choose any indentation depth, _inconsistent_ indentation in your code blocks will raise an error:
118115

119116
```python
@@ -122,27 +119,29 @@ While you may choose any indentation depth, _inconsistent_ indentation in your c
122119
... result = number_one + number_two + number_three # Indented by 4 spaces.
123120
... return result #this was only indented by 3 spaces
124121
...
125-
...
122+
...
126123
File "<stdin>", line 3
127124
return result
128125
^
129126
IndentationError: unindent does not match any outer indentation level
130127
```
131128

129+
132130
### Calling Functions
133131

134132
Functions are [_called_][calls] or invoked using their name followed by `()`.
135133
The number of arguments passed in the parentheses must match the number of parameters in the original function definition..
136134

137135
```python
138-
>>> def number_to_the_power_of(number_one, number_two):
136+
>>> def number_to_the_power_of(number_one, number_two):
139137
return number_one ** number_two
140138
...
141139

142140
>>> number_to_the_power_of(3,3)
143141
27
144142
```
145143

144+
146145
A mis-match between the number of parameters and the number of arguments will raise an error:
147146

148147
```python
@@ -154,6 +153,7 @@ TypeError: number_to_the_power_of() missing 1 required positional argument: 'num
154153

155154
```
156155

156+
157157
Calling functions defined inside a class (_class methods_) use `<class name>.<method name>(<parameters>)`, otherwise known as dot (.) notation:
158158

159159
```python
@@ -179,7 +179,6 @@ Calling functions defined inside a class (_class methods_) use `<class name>.<me
179179

180180
## Comments
181181

182-
183182
[Comments][comments] in Python start with a `#` that is not part of a string, and end at line termination.
184183
Unlike many other programming languages, Python **does not support** multi-line comment marks.
185184
Each line of a comment block must start with the `#` character.
@@ -196,12 +195,12 @@ x = "foo" # This is an in-line comment.
196195
# these should be used sparingly.
197196
```
198197

198+
199199
## Docstrings
200200

201201
The first statement of a function body can optionally be a [_docstring_][docstring], which concisely summarizes the function or object's purpose.
202202
Docstrings are declared using triple double quotes (""") indented at the same level as the code block:
203203

204-
205204
```python
206205

207206
# An example from PEP257 of a multi-line docstring.
@@ -212,27 +211,27 @@ def complex(real=0.0, imag=0.0):
212211
real -- the real part (default 0.0)
213212
imag -- the imaginary part (default 0.0)
214213
"""
215-
214+
216215
if imag == 0.0 and real == 0.0:
217216
return complex_zero
218217
...
219218

220219
```
221220

221+
222222
Docstrings are read by automated documentation tools and are returned by calling the special attribute `.__doc__` on the function, method, or class name.
223223
Docstrings can also function as [lightweight unit tests][doctests], which will be covered in a later exercise.
224-
They are recommended for programs of any size where documentation is needed, and their conventions are laid out in [PEP257][PEP257].
225-
224+
They are recommended for programs of any size where documentation is needed, and their conventions are laid out in [PEP257][pep257].
226225

227226
```python
228227
# An example on a user-defined function.
229228
>>> def number_to_the_power_of(number_one, number_two):
230229
"""Raise a number to an arbitrary power.
231-
230+
232231
:param number_one: int the base number.
233232
:param number_two: int the power to raise the base number to.
234233
:return: int - number raised to power of second number
235-
234+
236235
Takes number_one and raises it to the power of number_two, returning the result.
237236
"""
238237

@@ -263,7 +262,7 @@ encoding defaults to sys.getdefaultencoding().
263262
errors defaults to 'strict'.
264263
```
265264

266-
[PEP257]: https://www.python.org/dev/peps/pep-0257/
265+
[pep257]: https://www.python.org/dev/peps/pep-0257/
267266
[assignment statements]: https://docs.python.org/3/reference/simple_stmts.html#assignment-statements
268267
[calls]: https://docs.python.org/3/reference/expressions.html#calls
269268
[comments]: https://realpython.com/python-comments-guide/#python-commenting-basics

0 commit comments

Comments
 (0)