Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created January 18, 2024 21:38
Show Gist options
  • Save stephengruppetta/e92339abd1b46a177d289500e2942779 to your computer and use it in GitHub Desktop.
Save stephengruppetta/e92339abd1b46a177d289500e2942779 to your computer and use it in GitHub Desktop.
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