Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created May 15, 2023 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephengruppetta/87e038a721e00333497805e3181c96e2 to your computer and use it in GitHub Desktop.
Save stephengruppetta/87e038a721e00333497805e3181c96e2 to your computer and use it in GitHub Desktop.
# making_magic.py
from hogwarts_magic import Wizard, House, Wand
# ...
harry.assign_wand(
Wand("holly", "phoenix feather", 11)
)
# Harry Potter has a
# <hogwarts_magic.Wand object at 0x102aa1c10> wand.
print(harry.wand.wood)
# holly
print(harry.wand.core)
# phoenix feather
print(harry.wand.length)
# 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment