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
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.
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.
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)