Guest User

Untitled

a guest
Aug 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. # inventory.py
  2.  
  3. stuff = {"coal":42,"dagger":1,"iron":20,"torch":2}
  4. total_items = 0
  5. def display_inventory(inventory):
  6. for k,v in inventory.items():
  7. print(k,v)
  8. global total_items
  9. total_items = total_items + v
  10.  
  11. print("n")
  12. print("Total: " + str(total_items))
Add Comment
Please, Sign In to add comment