From f69b29270302744ed2580a324d6557d0d5a3c54d Mon Sep 17 00:00:00 2001 From: Varun Tiwari Date: Sun, 9 Oct 2022 23:20:59 +0530 Subject: [PATCH] Added script to check typing speed --- scripts/typing-speed-checker/README.md | 3 +++ scripts/typing-speed-checker/main.py | 32 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 scripts/typing-speed-checker/README.md create mode 100644 scripts/typing-speed-checker/main.py diff --git a/scripts/typing-speed-checker/README.md b/scripts/typing-speed-checker/README.md new file mode 100644 index 0000000..1c1c9db --- /dev/null +++ b/scripts/typing-speed-checker/README.md @@ -0,0 +1,3 @@ +# Typing Speed Checker + +You can check someone's typing speed with this simple Python script. It uses python's inbuild time module to test the user's typing speed. diff --git a/scripts/typing-speed-checker/main.py b/scripts/typing-speed-checker/main.py new file mode 100644 index 0000000..35be6fb --- /dev/null +++ b/scripts/typing-speed-checker/main.py @@ -0,0 +1,32 @@ +from time import time + +print("PARAGRAPH:") +print() + +typingString = "Medical transcription, also known as MT, is an allied health profession dealing with the process of transcribing voice-recorded medical reports that are dictated by physicians, nurses and other healthcare practitioners. Medical reports can be voice files, notes taken during a lecture, or other spoken material." + +words = len(typingString.split()) + +print(typingString) + +print("\nAfter finishing the test, press the enter key to see your time and speed (in WPM)") +input("\nPress any key to Start:") + +try: + print("\nTimer Started\n") + start = time() + t = input() + end = time() + if t == typingString: + total = round(end - start, 2) + print("\nCongrats! You typed everything correctly.") + print("You took was %s seconds" % total) + total = int(total) / 60 + print("Your speed was %s wpm" % (str(words // total))) + + else: + print("\nWrongly entered") + print("Try again") + +except KeyboardInterrupt: + print("") \ No newline at end of file