Build a Movie Ticket Booking Calculator - Step 20

Tell us what’s happening:

if age >= 21 or age >= 18 and show_time != ‘Evening’ or is_member:
print(‘Ticket booking condition satisfied’)
service_charges = 0
if seat_type == ‘Premium’:
service_charges = 5
elif seat_type == ‘Gold’:
service_charges = 3
else:
service_charges = 1

else:
print(‘Ticket booking failed due to restrictions’)

print(‘Service charges:’, service_charges)

You should have print(‘Service charges:’, service_charges) below your if…elif…else statemen

Your code so far

base_price = 15
age = 21
seat_type = 'Gold'
show_time = 'Evening'

if age > 17:
    print('User is eligible to book a ticket')

if age >= 21:
    print('User is eligible for Evening shows')
else:
    print('User is not eligible for Evening shows')

is_member = False
is_weekend = False

discount = 0
if is_member and age >= 21:
    discount = 3
    print('User qualifies for membership discount')
else:
    print('User does not qualify for membership discount')
print('Discount:', discount)

extra_charges = 0
if is_weekend or show_time == 'Evening':
    extra_charges = 2
    print('Extra charges will be applied')
else:
    print('No extra charges will be applied')
print('Extra charges:', extra_charges)

if age >= 21 or age >= 18 and show_time != 'Evening' or is_member:
    print('Ticket booking condition satisfied')
    service_charges = 0
    if seat_type == 'Premium':
        service_charges = 5

# User Editable Region

    elif seat_type == 'Gold':
        service_charges = 3
    else:
        service_charges = 1

# User Editable Region


else:
    print('Ticket booking failed due to restrictions')
    
print('Service charges:', service_charges)

and error You should have print('Service charges:', service_charges) below your if...elif...else statement.


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3 Safari/605.1.15

Challenge Information:

Build a Movie Ticket Booking Calculator - Step 20

Hi @Raiviic , welcome to freeCodeCamp’s forum !

First of all, you don’t need to copy/paste your code when you click the Help button in a workshop. Your code is joined automatically with your message. The blank space is for adding precisions about your code, ideas, what is happening, etc.

Here, you are ask to use if...elif...else as you did, then :

use the print() call to display a message that shows Service charges: followed by the updated value of service_charges.

Read carefully the instructions.

thanks for replay i reset code several times, i did everything what was asked from me, console shows no errors no nothing but always this “You should have print('Service charges:', service_charges) below your if...elif...else statement.” i checked all spaces and its even end of if..elif…else

i got it

hanks for help

1 Like

Nice ! Congrats on that !

can someone show us his correct code
i donno whats wrong with mine

base_price = 15

age = 21

seat_type = ‘Gold’

show_time = ‘Evening’

if age > 17:

print('User is eligible to book a ticket')

if age >= 21:

print('User is eligible for Evening shows')

else:

print('User is not eligible for Evening shows')

is_member = False

is_weekend = False

discount = 0

if is_member and age >= 21:

discount = 3

print('User qualifies for membership discount')

else:

print('User does not qualify for membership discount')

print(‘Discount:’, discount)

service_charges = 0

if age >= 21 or (age >= 18 and (show_time != ‘Evening’ or is_member)):

print('Ticket booking condition satisfied')

base_price = 15

age = 21

seat_type = ‘Gold’

show_time = ‘Evening’

if age > 17:

print('User is eligible to book a ticket')

if age >= 21:

print('User is eligible for Evening shows')

else:

print('User is not eligible for Evening shows')

is_member = False

is_weekend = False

discount = 0

if is_member and age >= 21:

discount = 3

print('User qualifies for membership discount')

else:

print('User does not qualify for membership discount')

print(‘Discount:’, discount)

service_charges = 0

if age >= 21 or (age >= 18 and (show_time != ‘Evening’ or is_member)):

print('Ticket booking condition satisfied')

if seat_type == 'Premium':

    service_charges = 5

elif seat_type == 'Gold':

    service_charges = 3

else:

    service_charges = 1

else:

print('Ticket booking failed due to restrictions')

print(‘Service charges:’, service_charges)

else:

print('Ticket booking failed due to restrictions')

print(‘Service charges:’, service_charges)

Please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Ask for Help button located on each challenge. This will automatically import your code in a readable format and pull in the challenge URL while still allowing you to ask any question about the challenge or your code.

Thank you.

1 Like