Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Character():
- def __init__(self, name):
- self.name = name
- self.affection = 1
- sam = Character("Sam")
- lulu = Character("Lulu")
- npc_dictionary = {"Sam": sam, "Lulu": lulu}
- print(npc_dictionary["Sam"].affection) # prints 1
- npc_dictionary["Sam"].affection = 10
- print(npc_dictionary["Sam"].affection) # prints 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement