Chapter 1 · Quest 3 of 5 · 10 XP
Mood Ring
💍 Bots make choices with if and else. If the test is true, the indented lines under if run. Otherwise the lines under else run.
coins = 3
if coins > 5:
print("Shop time!")
else:
print("Keep saving.")Keep saving.
Put a colon at the end of the if and else lines, and 4 spaces before the lines inside them. < means "less than".
Instructions
- Write
battery = 15on its own line. - If
batteryis less than 20, printLow power... - Otherwise (
else), printFeeling great!The checker also triesbattery = 80.
💡 Hint
The test is battery < 20. Colon after the if line and after else. Indent each print by 4 spaces.
bot.py
Terminal