Build a Movie Ticket Booking Calculator - Step 20

Tell us what’s happening:

my print statement:
print(‘Service charges:’, service_charges)

Feedback (copy and pasted):
You should have print(‘Service charges:’, service_charges) below your if…elif…else statement.

what is wrong with my code?

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)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36

Challenge Information:

Build a Movie Ticket Booking Calculator - Step 20

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-movie-ticket-booking-calculator/696cbb3985e23420cd45c58f.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @kiwibug5,

Did you print below a if...elif...else statement or did you print below a if...else statement?

Happy coding

if…elif…else

                                                                            

are you able to see my code? if you can its the last part of the code

Oh, I see your code just fine. And I can see that you are not printing where the instructions ask you to print. Pay close attention to the question I asked you. Are you sure you’re printing below a if...elif...else statement?

i think so? i don 't think i understand

Your code contains only one elif statement. Please locate that and print below the entire if...elif..else block.

I tried but it didn’t work. I genuinely don’t understand what I’m doing wrong

Please post your updated code, formatted as follows:

There are two ways you can format your code to make it easier to read and test:

  1. After you copy/paste your code into the editor, select it by dragging your cursor over it then click the (</>) button in the toolbar to automatically wrap your code in backticks. (You can click on the animated demo image below to enlarge it.)

  1. Manually add three backticks on a new line above your code and on a new line after your code. Note that a backtick is NOT the same as a single quote('). To find the backtick key on your keyboard, see this post.

To see changes to your post as you make them, you can click the (M+) button on the toolbar to bring up the rich text editor: