-
-
Save stephengruppetta/19976f1524f59524cba2eda6bc047da8 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
# making_magic.py | |
from hogwarts_magic import Wizard | |
harry = Wizard("Harry Potter", "stag", 1980) | |
hermione = Wizard("Hermione Granger", "otter", 1979) | |
print(harry.name) | |
# Harry Potter | |
print(harry.wand) | |
# None | |
print(hermione.name) | |
# Hermione Granger | |
print(hermione.wand) | |
# None | |
harry.assign_wand("holly, phoenix feather, 11 inches") | |
# Harry Potter has been assigned the holly, | |
# phoenix feather, 11 inches wand. | |
hermione.assign_wand("vine, dragon heartstring, 10 1/2 inches") | |
# Hermione Granger has been assigned the vine, | |
# dragon heartstring, 10 1/2 inches wand. | |
print(harry.wand) | |
# holly, phoenix feather, 11 inches | |
print(hermione.wand) | |
# vine, dragon heartstring, 10 1/2 inches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment