Guest User

Untitled

a guest
May 25th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. films = {
  2. "Avengers" : [12,5],
  3. "Baby Boss" : [6,2],
  4. "Coco" : [18,5],
  5. "Deadpool" :[21,5]
  6. }
  7.  
  8.  
  9. while True:
  10. choice = input("What film would you like to watch today?: ").strip().title()
  11.  
  12. #check film
  13. if choice in films:
  14. age = int(input("How old are you?").strip())
  15.  
  16.  
  17. # check age
  18. if age >= films [choice][0]:
  19.  
  20.  
  21. # check seats
  22. num_seats=films[choice][1]
  23. if num_seats > 0:
  24. print("Enjoy your film!")
  25. films[choice][1] = films[choice][1] - 1
  26. else:
  27. print ("Sorry, tickets currently sold out.")
  28.  
  29. else:
  30. print("You are too young to watch ")(choice)
  31.  
  32.  
  33. else:
  34. print("Sorry, We don't have that film currently...")
Add Comment
Please, Sign In to add comment