Skip to content

Commit 6e95e25

Browse files
authored
Merge pull request #115 from jgreener64/patch-1
Don't assign to in-built function in example
2 parents 6edf034 + 5f6e7bf commit 6e95e25

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/correctness/else_clause_on_loop_without_a_break_statement.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ The code below demonstrates some potential unintended behavior that can result w
1010

1111
.. code:: python
1212
13-
def contains_magic_number(list, magic_number):
14-
for i in list:
13+
def contains_magic_number(numbers, magic_number):
14+
for i in numbers:
1515
if i == magic_number:
1616
print("This list contains the magic number")
1717
else:
@@ -31,8 +31,8 @@ If the ``else`` clause should not always execute at the end of a loop clause, th
3131

3232
.. code:: python
3333
34-
def contains_magic_number(list, magic_number):
35-
for i in list:
34+
def contains_magic_number(numbers, magic_number):
35+
for i in numbers:
3636
if i == magic_number:
3737
print("This list contains the magic number.")
3838
# added break statement here

0 commit comments

Comments
 (0)