SHARE
TWEET

Untitled

a guest Dec 14th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Character():
  2.   def __init__(self, name):
  3.      self.name = name
  4.      self.affection = 1
  5.  
  6. sam = Character("Sam")
  7. lulu = Character("Lulu")
  8.  
  9. npc_dictionary = {"Sam": sam, "Lulu": lulu}
  10.  
  11. print(npc_dictionary["Sam"].affection) # prints 1
  12. npc_dictionary["Sam"].affection = 10
  13.  
  14. print(npc_dictionary["Sam"].affection) # prints 10
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top