Skip to content

Commit 0cae751

Browse files
committed
prevent division by zero
1 parent 2eab67d commit 0cae751

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

utilities/Typing-Speed-Tester/Typing-Speed-Tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Calculate words per minute
3838
words = len(sentence.split())
39-
wpm = (words / time_taken) * 60
39+
wpm = (words / time_taken) * 60 if time_taken > 0 else 0
4040

4141
# Calculate accuracy
4242
correct_chars = 0

0 commit comments

Comments
 (0)