Last active
October 29, 2019 19:49
-
-
Save amcgregor/0795eb5e58b2a7589150e644d71ad5be to your computer and use it in GitHub Desktop.
Gut-feelings and code go together…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here's a simple (and silly, but it's an example) function definition in Python: | |
def append(value, l=[]): | |
"""Append a value to a list, return that list.""" | |
l.append(value) | |
return l | |
print(append(27)) # [27] | |
print(append(42)) # ? | |
print(append(96)) # ? | |
# Clguba shapgvba nethzrag qrsnhygf ner cebprffrq bapr, ng qrpynengvba gvzr, naq erpbeqrq ntnvafg gur shapgvba. | |
# Vg pna or uvtuyl aba-boivbhf gb arj qrirybcref gung gur qrsnhygf nera'g er-rinyhngrq ba rnpu pnyy. | |
# Searchable term: mutable defaults |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment