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 aloneShared 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
The user enters the number of minutes they have played.
The program checks whether the number is greater than 120.
If it is, the program says the user played for too long.
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
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.
- 2
Step 2
Check whether the user is over the limit
Use an if statement to check whether minutes_played is greater than 120.
- 3
Step 3
Print the warning message
If the user is over the limit, print: You played games for too long!
- 4
Step 4
Handle the other outcome
Use else to print: You are under your time limit!
- 5
Step 5
Test both outcomes
Run the program with one number above 120 and one below 120 to check both messages.
More to explore
Want a different challenge?
Browse more guided projects, or come back and start this one whenever you are ready.