1. Ticket first, then seat
Write code Easy ✓ CompletedA cinema only asks about the seat once the customer has a ticket. Write a nested if that sets message:
- no ticket (
has_ticketisFalse):"Buy a ticket first" - ticket but
seatis an empty string"":"Choose a seat" - ticket and a seat:
"Enjoy the film"
Then print message. Try other values to see each message, then set them back to has_ticket = True and seat = "" before pressing Check.
has_ticket = True
seat = ""
# nested if: first check has_ticket, then check seat inside it
has_ticket = True
seat = ""
if has_ticket:
if seat == "":
message = "Choose a seat"
else:
message = "Enjoy the film"
else:
message = "Buy a ticket first"
print(message)