Year 7 · Python · Challenge 2

Theme Park Ticket Checker

Use if / elif / else and and / or to decide ticket price and ride access from age and height.

conditionalsand / orinput

Scenario: A theme park needs a ticket program. Guests type their age and height in centimetres.

Ticket prices

  • Under 5 years: free (print Free entry)
  • Age 5 to 12: £15
  • Age 13 to 64: £25
  • Age 65 or over: £12

Ride rule

The big roller coaster needs age 12 or over and height 140 cm or more.

Your tasks

  1. Ask for age (integer) and height in cm (integer).
  2. Print the correct ticket message using if / elif / else.
  3. Then check the roller coaster rule with and. Print either You can ride the roller coaster or Sorry, not tall or old enough for the roller coaster.
⚠️ Check the bigger age groups carefully. Put the under-5 check first.
💡 Try the whole challenge in your editor first. Only reveal the solution when you have had a proper go.

Previous: Challenge 1 · Year 7 tutorial · Next: Challenge 3