Python Quest  /  Mission 4
Loading Python...
World 1 · Mission 4

Dangerous Path

Bolt has reached a fork in the trail. His scanner reports a danger level of 8 out of 10. Use an if condition to decide which route he should take.

Route Scanner

Your Python condition will choose Bolt's route.

Danger level
8 / 10 High danger
🌳

Safe Route

Longer, but protected from the danger ahead.

⚠️

Fast Route

Shorter, but dangerous when the scanner reading is high.

Waiting for your Python decision.
Mission objective

Make a decision

The variable danger_level stores the scanner reading.

If the danger level is greater than 5, Bolt should take the safe path. Otherwise, he can use the fast path.

Check whether danger_level > 5
Use both if and else
Send Bolt down the safe route

Check your understanding

If danger_level were 3, which branch would run?

Mission complete!

You used an if/else condition to make your program choose between two different actions.

Your Python code

Complete the condition