Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. def pizza_counter():
  2. global pizza_sold
  3. pizza_seller = input("Enter employee who sold it")
  4. pizza_name = input("Enter the pizza to update")
  5. pizza_amount = int(input("Enter how much by"))
  6.  
  7. print(pizza_amount)
  8. print(pizza_sold)
  9. pizza_sold[pizza_seller][pizza_name] += pizza_amount
  10.  
  11. print(pizza_sold)
  12.  
  13.  
  14.  
  15. error message = Traceback (most recent call last):
  16. 10
  17. File "C:/Users/Nilay - School/PycharmProjects/Pizza-Sales-Counter/main.py", line 56, in <module>
  18. menu()
  19. File "C:/Users/Nilay - School/PycharmProjects/Pizza-Sales-Counter/main.py", line 54, in menu
  20. menu_options[command]()
  21. File "C:/Users/Nilay - School/PycharmProjects/Pizza-Sales-Counter/main.py", line 40, in pizza_counter
  22. pizza_sold[pizza_seller][pizza_name] += pizza_amount
  23. {'John': {'Margarita': {'amount': 0, 'income': 0}, 'Marinara': {'amount': 0, 'income': 0}, 'Pepperoni': {'amount': 0, 'income': 0}, 'Veggie': {'amount': 0, 'income': 0}, 'Chicken': {'amount': 0, 'income': 0}, 'Four cheeses': {'amount': 0, 'income': 0}, 'Hawaiian': {'amount': 0, 'income': 0}}, 'Susan': {'Margarita': {'amount': 0, 'income': 0}, 'Marinara': {'amount': 0, 'income': 0}, 'Pepperoni': {'amount': 0, 'income': 0}, 'Veggie': {'amount': 0, 'income': 0}, 'Chicken': {'amount': 0, 'income': 0}, 'Four cheeses': {'amount': 0, 'income': 0}, 'Hawaiian': {'amount': 0, 'income': 0}}, 'Lauren': {'Margarita': {'amount': 0, 'income': 0}, 'Marinara': {'amount': 0, 'income': 0}, 'Pepperoni': {'amount': 0, 'income': 0}, 'Veggie': {'amount': 0, 'income': 0}, 'Chicken': {'amount': 0, 'income': 0}, 'Four cheeses': {'amount': 0, 'income': 0}, 'Hawaiian': {'amount': 0, 'income': 0}}, 'Alex': {'Margarita': {'amount': 0, 'income': 0}, 'Marinara': {'amount': 0, 'income': 0}, 'Pepperoni': {'amount': 0, 'income': 0}, 'Veggie': {'amount': 0, 'income': 0}, 'Chicken': {'amount': 0, 'income': 0}, 'Four cheeses': {'amount': 0, 'income': 0}, 'Hawaiian': {'amount': 0, 'income': 0}}}
  24. TypeError: unsupported operand type(s) for +=: 'dict' and 'int'
  25.  
  26. Process finished with exit code 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement