11 lines
291 B
Python
11 lines
291 B
Python
# no.side.effects.py
|
|
# This file is not meant to be run
|
|
>>> numbers = [4, 1, 7, 5]
|
|
>>> sorted(numbers) # won't sort the original `numbers` list
|
|
[1, 4, 5, 7]
|
|
>>> numbers # let's verify
|
|
[4, 1, 7, 5] # good, untouched
|
|
>>> numbers.sort() # this will act on the list
|
|
>>> numbers
|
|
[1, 4, 5, 7]
|