Build a Movie Ticket Booking Calculator - Step 9

Tell us what’s happening:

discount = 0
if is_member:
discount = 3
print(‘User qualifies for membership discount:’)
else:
print(‘User does not qualify for membership discount’)
print(‘Discount:’, discount)

i would kindly ask why im am getting a " You should have print(‘Discount:’, discount) below your if…else statement."? i have it already under the if and else statement.

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 = True
is_weekend = False

discount = 0

# User Editable Region

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

# User Editable Region

Your browser information:

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

Challenge Information:

Build a Movie Ticket Booking Calculator - Step 9

You have an indentation error. The print statement is not part of the else statement.

Hello Thanks for taking time to help me out. i just did what you suggested. but the same issue. please see my screen shot. your help is very much appreciated.

Hi

Can you please post all your updated code so I can test it. Put 3 backticks before and after the code.

Photos/screenshots of an error can be helpful, but it also helps to provide the complete code. Posting the code helps us help you better!

When you enter a code, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Try cut and pasting what is in the error message over your print call. Maybe you have some excess whitespace.

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 = True
is_weekend = False

discount = 0
if is_member:
    discount = 3
    print(‘User qualifies for membership discount:’)
else:
    print(‘User does not qualify for membership discount’)

print(‘Discount:’, discount)

please see above code as requested, its the same issue. Thanks

You have changed the seed code here.

I suggest you reset and don’t change any of the seed code

    print(‘User is eligible for Evening shows’)else:print(‘User is not eligible for Evening shows’)

1 Like

Thanks for taking your time to help me out. very much appreciated.

1 Like