Start building now

Choose how you want to begin this project.

Open it privately for practice or create a shared workspace to build it together.

No setup required • Guided steps inside the editor

Private practice

Open a private editor and work through the steps at your own pace.

Start project alone

Shared workspace

Create a live session so you can teach, pair, or build the project together.

What you'll build

A program that asks for the number of minutes played and outputs a message depending on whether the user is over the limit.

What you'll learn

  • How to take numeric input from the user
  • How to compare a value using if and else
  • How to output different messages based on a condition
  • How to turn a flowchart into Python code

How it works

1

The user enters the number of minutes they have played.

2

The program checks whether the number is greater than 120.

3

If it is, the program says the user played for too long.

4

If not, the program says they are under the time limit.

Build path

These steps appear inside the editor so you can build one part at a time.

  1. 1

    Step 1

    Ask for the number of minutes played

    Use input() and int() to store the number of minutes in a variable called minutes_played.

    Complete in the editorHint available
  2. 2

    Step 2

    Check whether the user is over the limit

    Use an if statement to check whether minutes_played is greater than 120.

    Complete in the editorHint available
  3. 3

    Step 3

    Print the warning message

    If the user is over the limit, print: You played games for too long!

    Complete in the editorHint available
  4. 4

    Step 4

    Handle the other outcome

    Use else to print: You are under your time limit!

    Complete in the editorHint available
  5. 5

    Step 5

    Test both outcomes

    Run the program with one number above 120 and one below 120 to check both messages.

    Complete in the editorHint available

More to explore

Browse more guided projects, or come back and start this one whenever you are ready.