Python Control Flow
💡
Exercise 15

The Cyclone 15 XP Medium

Ctrl+Enter Run Ctrl+S Save

Logical operators let us combine multiple conditions:

  • `and` — both conditions must be True
  • `or` — at least one condition must be True
  • `not` — reverses True/False
age = 12 height = 140 if age >= 10 and height >= 120: print('You can ride!') else: print('Sorry, not yet.')

The Cyclone is a roller coaster at Coney Island. To ride, you must be at least 137 cm tall.

📋 Instructions
Create two variables: - `height` = `140` - `credits` = `10` A person can ride The Cyclone if: - `height` >= `137` **AND** `credits` >= `5` If both conditions are met, print: `Enjoy the ride!` Otherwise, print: `You can't ride.` Expected output: ``` Enjoy the ride! ```
Use: if height >= 137 and credits >= 5:. You've got this — take it step by step!
⚠️ Try solving it yourself first — you'll learn more!
age = 12
height = 140

if age >= 10 and height >= 120:
    print('You can ride!')
else:
    print('Sorry, not yet.')
🧪 Test Cases
Input
Run your code
Expected
Enjoy the ride!
Expected program output
main.py
Hi! I'm Rex 👋
Output
Ready. Press ▶ Run or Ctrl+Enter.