-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
beginner-friendlybugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
π― Description
Build a simple program that measures how fast and accurately a user can type a given prompt.
- Show a short text/snippet.
- Time how long the user takes to type it.
- Compute WPM (Words Per Minute) and accuracy (%).
- Display a summary at the end.
π What Youβll Practice
- Input/output
- Timing & basic math
- String comparison
- Functions & clean code
- CLI user experience
β Tasks
-
Create a new folder:
your_name/typing_speed_tester/ -
Add main script:
typing_speed_tester.py -
Include a sample prompt in code (or load from
prompts.txt) -
Display the prompt clearly and start timing when user begins typing
-
Stop timing when user submits input (e.g., presses Enter)
-
Calculate:
- Time taken (seconds)
- WPM using:
WPM = (characters_typed / 5) / minutes_elapsed - Accuracy (%) using:
accuracy = (correct_chars / total_chars_typed) * 100
-
Print a neat summary with:
- Prompt length (chars & words)
- Time taken
- WPM
- Accuracy
-
Add
README.mdexplaining:- What the project does
- How to run it
- Example input/output
-
(Optional) Add
requirements.txt(if you use any libraries)
π§ͺ Acceptance Criteria
- Running
python typing_speed_tester.pylaunches the tester in the terminal. - User sees a prompt, types their response, and gets time, WPM, and accuracy.
- WPM and accuracy are calculated using the formulas above.
- Code is organized into small functions (e.g.,
get_prompt(),measure_time(),calculate_metrics(),compare_text()). README.mdcontains run instructions and a sample run.
π§© Example (CLI flow)
Prompt:
"The quick brown fox jumps over the lazy dog."
Start typing and press Enter when done:
> The quick brown fox jumps over the lazy dog.
Time: 7.84s
WPM: 68.5
Accuracy: 100.0%
π‘ Hints
- Use
time.perf_counter()(Python) for precise timing. - Normalize strings before comparison (e.g., compare char-by-char; consider trimming trailing whitespace).
- Decide how to handle backspaces/typos; simplest is to compare final typed string against the prompt.
π Stretch Goals (Optional)
- Live timer while typing
- CPM (characters per minute) in addition to WPM
- Per-word accuracy and highlight mistakes
- Multiple prompts loaded from a file
- Best score tracking via a local JSON file
- Difficulty levels (short/medium/long prompts)
- Colorful CLI output (e.g.,
Colorama)
π·οΈ Labels
good first issue beginner-friendly help wanted
Need help getting started? Follow our First Contributions Guide or ask in Discussions π¬
Good luck and happy coding! π
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
beginner-friendlybugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed