Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://pastebin.com/u/TTpocToXaKep
- import time
- def typing_speed_test():
- words = "The quick brown fox jumps over the lazy dog."
- print("Type the following sentence:")
- print(words)
- start_time = time.time()
- user_input = input("Your response: ")
- end_time = time.time()
- total_time = end_time - start_time
- accuracy = (len(words) - (len(words) - len(user_input))) * 100 / len(user_input)
- wpm = len(user_input) / 5 / total_time * 60
- print("Your total time is %s seconds" % total_time)
- print("Your accuracy rate is %s %%" % accuracy)
- print("Your words per minute rate is %s wpm" % wpm)
- typing_speed_test()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement