Мой профиль
ACTIVITY 18 / 50

Station controller

Try as many times as you need

Let’s understand

Combine input, comparison and branching into a small program. Predict the answer before running it. Test ordinary values and boundaries, such as exactly the energy required.

Listen to the explanation

Example

# input → condition → result
YOUR MISSION

Read energy and cost. If there is enough energy, print what remains. Otherwise print STOP.

I need a hint

Compare energy >= cost, then subtract cost in that branch.

How to find an error
  1. Read the last line of the error message.
  2. Find the indicated line. Check quotes, parentheses and indentation.
  3. Change one thing and run again.

main.py

4 spaces

Your draft stays in this browser.

Result

Python
Your program’s output will appear here. Click Run.