Step 20 Construir un calculador de reservas de entradas de cine

Hi everyone, I’m having trouble with a freeCodeCamp Python exercise. I’m supposed to add an elif statement to check whether seat_type == 'Gold' and set service_charges = 3. I added it correctly as far as I can tell, but the tests fail with an indentation error.

The error appears around this section:

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)

FreeCodeCamp says: “Your code has an indentation error. You may need to add pass on a new line to form a valid code block.”

I’ve checked the indentation several times, but I still get the same error. Could someone help me figure out what is causing it?

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.


the code you provided does not have an indentation error, but you would need to show all your code to be able to pinpoint that

print('Service charges:', service_charges) is in the wrong place tho

Welcome to the forum @yuriy.neux2012,

It looks like you may have overlooked this instruction:

Below the nested if...elif...else statement, use the print() call to display a message that shows Service charges: followed by the updated value of service_charges.

Happy coding