-
-
Save stephengruppetta/0342b22facca07c7fd9af6595a9e68f2 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( | |
"Ids for the three dictionaries", | |
*(id(item) for item in street), sep="\n", | |
) | |
# 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( | |
"Ids for the three dictionaries", | |
*(id(item) for item in street), sep="\n", | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment