← back to unit
Easy
# basics conditionals
Combining Conditions with and
You can use and inside an if to require both conditions to be true:
if height >= 120 and has_adult == 1:
print("Can ride!")
else:
print("Cannot ride.")
Your turn: read height and has_adult (1 means yes, 0 means no). Print Can ride! if height >= 120 and has_adult == 1 — otherwise print Cannot ride.
💡 need a hint?
pyb-cond-and.py🔒 given lines are locked — write your code in between
loading...