-
-
Save stephengruppetta/e92339abd1b46a177d289500e2942779 to your computer and use it in GitHub Desktop.
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
import pprint | |
street = ( | |
{ | |
"House number": 1, | |
"Residents": "The Cleeses", | |
"Number of residents": 3, | |
}, | |
{ | |
"House number": 3, | |
"Residents": "The Gruppettas", | |
"Number of residents": 4, | |
}, | |
{ | |
"House number": 5, | |
"Residents": "The Palins", | |
"Number of residents": 2, | |
}, | |
# ... Rest of the street, | |
# first the odd numbers up to 17, | |
# and then from 18 down to 2 | |
) | |
print("Before the Cleeses moved out") | |
pprint.pprint(street) | |
print(id(street)) | |
# The change: The Cleeses move out | |
street[0]["Residents"] = None | |
street[0]["Number of residents"] = 0 | |
print("\nAfter the Cleeses moved out") | |
pprint.pprint(street) | |
print(id(street)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment