A fun, fast-paced Python command-line game that challenges users with 10 random math problems. See how quickly and accurately you can solve them - great for practicing arithmetic or building beginner Python skills!
- Generates random math problems using:
- Addition (
+) - Subtraction (
-) - Multiplication (
*)
- Addition (
- Tracks the total number of attempts, including incorrect ones
- Measures the total time taken to complete all problems
- Validates input to ensure user enters numbers only
- Simple, engaging feedback after each response
- The game generates 10 random math problems using +, -, or *, with numbers between 2 and 12.
- A timer starts as soon as the user presses Enter.
- The user must solve each problem correctly to move on.
- Each guess (correct or incorrect) is counted as an attempt.
- After all problems are solved, the program displays: Total time taken , Total number of attempts
-
Clone or download this repository
-
Open a terminal and navigate to the folder
-
Run the script with Python:
python timed_math_challenge.py
Press enter to start the timed math challenge.
------------------------------------
Problem #1: 4 * 7 = 29
Incorrect, try again.
Problem #1: 4 * 7 = 28
Correct!
...
------------------------------------
You finished the quiz in 34.27 seconds with 13 attempts.
Python 3.x (No external packages needed!)
- Using random to generate dynamic math problems
- Measuring execution time with time
- Input validation and exception handling
- Loops, conditionals, and reusable functions
Created by Toshaksha - powered by Python and brainpower 🧠⚡
Challenge yourself. Train your brain. Beat your time!