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

Your control panel

Try as many times as you need

Let’s understand

Combine a list, loop and condition. The program receives an energy budget and decides which devices it can activate in order. Each successful activation reduces the remaining budget. Track the state, not just the first answer.

Listen to the explanation

Example

# input → list → loop → decision → remaining energy
YOUR MISSION

Read energy. Visit costs = [3, 5, 2]. If affordable, subtract the cost and print ON; otherwise print WAIT. Finally print the remaining energy.

I need a hint

Put the check and subtraction inside for; the final print goes after the loop.

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.