-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcinema.py
More file actions
31 lines (23 loc) · 747 Bytes
/
cinema.py
File metadata and controls
31 lines (23 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
films = {
"Finding Dory": [3,5],
"Bourne": [18,5],
"Tarzan": [15,5],
"Ghost Busters":[12, 5]
}
while True:
choice = input("What film would you like to watch?: ").strip().title()
if choice in films:
age = int(input("How old are you?: ").strip())
# check user age
if age >= films[choice][0]:
# check enough seats
num_seats = films[choice][1]
if num_seats > 0:
print("Enjoy the film!")
films[choice][1] = films[choice][1] - 1
else:
print("Sorry, we are sold out!")
else:
print("You are too young to see that film!")
else:
print("We don't have that film...")