From 532f827a37926ec3e0602e315a54e13e13abcf37 Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Tue, 16 Sep 2025 20:04:15 -0500 Subject: [PATCH 01/13] Add default values to get rid of magic numbers in temp.py --- pySure/temp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pySure/temp.py b/pySure/temp.py index d9ecdd4..e1d8c5a 100644 --- a/pySure/temp.py +++ b/pySure/temp.py @@ -1,3 +1,6 @@ +C_CONSTANT = 9/5 +F_CONSTANT = 32 + # Choose the unit of temperature conversion unit = input("Choose the unit of temperature conversion (C/F): ").strip().upper() @@ -6,11 +9,11 @@ # Function to convert Celsius to Fahrenheit def temp_c_to_f(c): - return (c*9/5) + 32 + return (c*C_CONSTANT) + F_CONSTANT # Function to convert Fahrenheit to Celsius def temp_f_to_c(f): - return (f - 32) * 5/9 + return (f - F_CONSTANT) * 1/C_CONSTANT # Check the chosen unit and perform the conversion if unit == "C": From d49d37491d48918e6ef73d5937eaf8ff085d9e0c Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Tue, 16 Sep 2025 20:11:03 -0500 Subject: [PATCH 02/13] Create README for temperature converter --- pySure/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pySure/README.md diff --git a/pySure/README.md b/pySure/README.md new file mode 100644 index 0000000..e69de29 From 1b01c9e95483123f78f7a191e7874d4f7594c874 Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Tue, 16 Sep 2025 20:17:57 -0500 Subject: [PATCH 03/13] Finish README for temp.py --- pySure/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pySure/README.md b/pySure/README.md index e69de29..4a742f1 100644 --- a/pySure/README.md +++ b/pySure/README.md @@ -0,0 +1,11 @@ +# Temperature Converter + +## 🚀 What the Project Does +A simple python program that converts either Fahrenheit to Celsius or Celsius to Fahrenheit. + +## 🛠️ How to Run +Make sure you have Python 3 installed. + +Then run the command in terminal or command prompt. +```bash +python temp.py From 92ebd75fea3d7038b574977190e78d2f2af2e7a0 Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Fri, 19 Sep 2025 21:30:00 -0500 Subject: [PATCH 04/13] Add initial implementation of typing speed tester with project description --- .../KyleighHarkless/Typing_speed_tester.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 week1_projects/KyleighHarkless/Typing_speed_tester.py diff --git a/week1_projects/KyleighHarkless/Typing_speed_tester.py b/week1_projects/KyleighHarkless/Typing_speed_tester.py new file mode 100644 index 0000000..f551c38 --- /dev/null +++ b/week1_projects/KyleighHarkless/Typing_speed_tester.py @@ -0,0 +1,26 @@ +"""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.md explaining: + +What the project does +How to run it +Example input/output + +(Optional) Add requirements.txt (if you use any libraries)""" +def typing_speed_test(): + pass \ No newline at end of file From d646a6bfdf58cd3e018771347315bc75b0ceb9c6 Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Fri, 19 Sep 2025 21:44:06 -0500 Subject: [PATCH 05/13] Implement typing speed test functionality with sample prompts --- .../KyleighHarkless/Typing_speed_tester.py | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/week1_projects/KyleighHarkless/Typing_speed_tester.py b/week1_projects/KyleighHarkless/Typing_speed_tester.py index f551c38..bf9a19e 100644 --- a/week1_projects/KyleighHarkless/Typing_speed_tester.py +++ b/week1_projects/KyleighHarkless/Typing_speed_tester.py @@ -1,3 +1,5 @@ +import time + """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) @@ -23,4 +25,24 @@ (Optional) Add requirements.txt (if you use any libraries)""" def typing_speed_test(): - pass \ No newline at end of file + # WPM = (characters_typed / 5) / minutes_elapsed + # accuracy = (correct_chars / total_chars_typed) * 100 + + print("Type this sentence as fast as you can!") + + prompt1 = "The quick brown fox jumps over the lazy dog." + prompt2 = "Despite the heavy rain, Julia sprinted across the crowded street—dodging cars, " \ + "splashing through puddles, and laughing the entire way." + + print(prompt1) + + start = time.time() + typing = input(">>> ") + end = time.time() + + +typing_speed_test() + + + + \ No newline at end of file From 31c64dee77f4059b313cca068fe103d2b6521c2b Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Fri, 19 Sep 2025 21:56:02 -0500 Subject: [PATCH 06/13] Refactor typing speed test function --- .../KyleighHarkless/Typing_speed_tester.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/week1_projects/KyleighHarkless/Typing_speed_tester.py b/week1_projects/KyleighHarkless/Typing_speed_tester.py index bf9a19e..8114b7f 100644 --- a/week1_projects/KyleighHarkless/Typing_speed_tester.py +++ b/week1_projects/KyleighHarkless/Typing_speed_tester.py @@ -31,15 +31,22 @@ def typing_speed_test(): print("Type this sentence as fast as you can!") prompt1 = "The quick brown fox jumps over the lazy dog." - prompt2 = "Despite the heavy rain, Julia sprinted across the crowded street—dodging cars, " \ - "splashing through puddles, and laughing the entire way." + # prompt2 = "Despite the heavy rain, Julia sprinted across the crowded street—dodging cars, " \ + # "splashing through puddles, and laughing the entire way." print(prompt1) - + start = time.time() - typing = input(">>> ") + typed_response = input(">>> ") end = time.time() + characters_typed = len(typed_response.split()) + + WPM = (characters_typed / 5) / (end - start) + + print(f"Words per minute: {WPM:.2f} seconds") + + typing_speed_test() From 9fcbff9488495f31979089d29d2f0bddf3761746 Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Fri, 19 Sep 2025 23:35:04 -0500 Subject: [PATCH 07/13] Add accuracy function to be used in typing speed --- .../KyleighHarkless/Typing_speed_tester.py | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/week1_projects/KyleighHarkless/Typing_speed_tester.py b/week1_projects/KyleighHarkless/Typing_speed_tester.py index 8114b7f..9dd5bc7 100644 --- a/week1_projects/KyleighHarkless/Typing_speed_tester.py +++ b/week1_projects/KyleighHarkless/Typing_speed_tester.py @@ -25,14 +25,11 @@ (Optional) Add requirements.txt (if you use any libraries)""" def typing_speed_test(): - # WPM = (characters_typed / 5) / minutes_elapsed - # accuracy = (correct_chars / total_chars_typed) * 100 - print("Type this sentence as fast as you can!") prompt1 = "The quick brown fox jumps over the lazy dog." - # prompt2 = "Despite the heavy rain, Julia sprinted across the crowded street—dodging cars, " \ - # "splashing through puddles, and laughing the entire way." + prompt2 = "Despite the heavy rain, Julia sprinted across the crowded street—dodging cars, " \ + "splashing through puddles, and laughing the entire way." print(prompt1) @@ -41,10 +38,34 @@ def typing_speed_test(): end = time.time() characters_typed = len(typed_response.split()) - WPM = (characters_typed / 5) / (end - start) print(f"Words per minute: {WPM:.2f} seconds") + print(f"Your accuracy: {accuracy_checker(prompt1, typed_response):.2f}%") + + # if WPM < 0.25: + # print("You're ready for a harder challenge!") + # print(f"{prompt2}\n---------") + +def accuracy_checker(prompt:str, user_input:str): + correct_char = 0 + + for i in range(min(len(prompt), len(user_input))): + if prompt[i] == user_input[i]: + correct_char += 1 + + accuracy = (correct_char / len(prompt)) * 100 + + return accuracy + + + + + + + + + From 68a36581069a2718045760b3aeaf2d886060c78f Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Sat, 20 Sep 2025 00:04:37 -0500 Subject: [PATCH 08/13] Fix typing speed test function --- .../KyleighHarkless/Typing_speed_tester.py | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/week1_projects/KyleighHarkless/Typing_speed_tester.py b/week1_projects/KyleighHarkless/Typing_speed_tester.py index 9dd5bc7..8739705 100644 --- a/week1_projects/KyleighHarkless/Typing_speed_tester.py +++ b/week1_projects/KyleighHarkless/Typing_speed_tester.py @@ -25,52 +25,53 @@ (Optional) Add requirements.txt (if you use any libraries)""" def typing_speed_test(): - print("Type this sentence as fast as you can!") + print("\nvvv Type this sentence as fast as you can! vvv\n ----------------------------------------") prompt1 = "The quick brown fox jumps over the lazy dog." prompt2 = "Despite the heavy rain, Julia sprinted across the crowded street—dodging cars, " \ "splashing through puddles, and laughing the entire way." - print(prompt1) + print(f"{prompt1}\n ----------------------------------------\n") - start = time.time() - typed_response = input(">>> ") - end = time.time() + start1 = time.time() + typed_response1 = input(">>> ") + end1 = time.time() - characters_typed = len(typed_response.split()) - WPM = (characters_typed / 5) / (end - start) + secs1 = (end1 - start1) - print(f"Words per minute: {WPM:.2f} seconds") - print(f"Your accuracy: {accuracy_checker(prompt1, typed_response):.2f}%") + accuracy1 = accuracy_checker(prompt1, typed_response1) - # if WPM < 0.25: - # print("You're ready for a harder challenge!") - # print(f"{prompt2}\n---------") + print(f"It took you, {secs1:.2f} seconds!") + print(f"Your accuracy: {accuracy1:.2f}%") + + if secs1 < 10 and accuracy1 > 80: + print("You're ready for a harder challenge!") + print("\nvvv Type this sentence as fast as you can! vvv\n ----------------------------------------") + print(f"{prompt2}\n ----------------------------------------") + + start2 = time.time() + typed_response2 = input(">>> ") + end2 = time.time() + + secs2 = end2 - start2 + + accuracy2 = accuracy_checker(prompt2, typed_response2) + + print(f"It took you, {secs2:.2f} seconds!") + print(f"Your accuracy: {accuracy2:.2f}%") def accuracy_checker(prompt:str, user_input:str): correct_char = 0 + + prompt_strip = prompt.strip() + user_input_strip = user_input.strip() - for i in range(min(len(prompt), len(user_input))): - if prompt[i] == user_input[i]: + for i in range(min(len(prompt_strip), len(user_input_strip))): + if prompt_strip[i] == user_input_strip[i]: correct_char += 1 accuracy = (correct_char / len(prompt)) * 100 return accuracy - - - - - - - - - - - -typing_speed_test() - - - - \ No newline at end of file +typing_speed_test() \ No newline at end of file From 455c9f0513ef90f0f405803490585f0fde4eeb75 Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Sat, 20 Sep 2025 00:05:22 -0500 Subject: [PATCH 09/13] Remove project setup comments --- .../KyleighHarkless/Typing_speed_tester.py | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/week1_projects/KyleighHarkless/Typing_speed_tester.py b/week1_projects/KyleighHarkless/Typing_speed_tester.py index 8739705..1f83d4f 100644 --- a/week1_projects/KyleighHarkless/Typing_speed_tester.py +++ b/week1_projects/KyleighHarkless/Typing_speed_tester.py @@ -1,29 +1,5 @@ import time -"""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.md explaining: - -What the project does -How to run it -Example input/output - -(Optional) Add requirements.txt (if you use any libraries)""" def typing_speed_test(): print("\nvvv Type this sentence as fast as you can! vvv\n ----------------------------------------") From 9002ee8a69cb17772bf4290ca53bc89729b20032 Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Sat, 20 Sep 2025 00:06:10 -0500 Subject: [PATCH 10/13] Add README file for typing speed function --- week1_projects/KyleighHarkless/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 week1_projects/KyleighHarkless/README.md diff --git a/week1_projects/KyleighHarkless/README.md b/week1_projects/KyleighHarkless/README.md new file mode 100644 index 0000000..c3a92bb --- /dev/null +++ b/week1_projects/KyleighHarkless/README.md @@ -0,0 +1,23 @@ +# Typing Speed Tester + +A simple Python program that measures how fast and accurately you can type a given sentence. + +## Features + +- Displays a sentence prompt for the user to type. +- Records the time taken to type the sentence. +- Calculates typing accuracy based on how many characters match the prompt. +- Displays a neat summary including: + - Time taken (seconds) + - Accuracy (%) + +> Optionally, you could extend this to multiple prompts or measure words per minute. + +## How to Run + +1. Make sure you have Python installed (version 3.x recommended). +2. Clone or download this repository. +3. Run the script: + +```bash +python typing_speed_tester.py \ No newline at end of file From 0ea4792367c1c0e3b3d1e3c96d956906d244a388 Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Sat, 20 Sep 2025 00:08:49 -0500 Subject: [PATCH 11/13] Add last message --- week1_projects/KyleighHarkless/Typing_speed_tester.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/week1_projects/KyleighHarkless/Typing_speed_tester.py b/week1_projects/KyleighHarkless/Typing_speed_tester.py index 1f83d4f..da3c137 100644 --- a/week1_projects/KyleighHarkless/Typing_speed_tester.py +++ b/week1_projects/KyleighHarkless/Typing_speed_tester.py @@ -36,6 +36,9 @@ def typing_speed_test(): print(f"It took you, {secs2:.2f} seconds!") print(f"Your accuracy: {accuracy2:.2f}%") + else: + print("\nNot too bad try again and get better results for a harder challenge!") + def accuracy_checker(prompt:str, user_input:str): correct_char = 0 From 401ea93b52a37d03656298de0d08f97a5413df3c Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Sat, 20 Sep 2025 00:28:35 -0500 Subject: [PATCH 12/13] Update typing speed test logic and improve accuracy feedback --- .../KyleighHarkless/Typing_speed_tester.py | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/week1_projects/KyleighHarkless/Typing_speed_tester.py b/week1_projects/KyleighHarkless/Typing_speed_tester.py index da3c137..ed00036 100644 --- a/week1_projects/KyleighHarkless/Typing_speed_tester.py +++ b/week1_projects/KyleighHarkless/Typing_speed_tester.py @@ -1,6 +1,8 @@ import time def typing_speed_test(): + start = input("Welcome to the typing test!\nPress 'enter' to start! ") + print("\nvvv Type this sentence as fast as you can! vvv\n ----------------------------------------") prompt1 = "The quick brown fox jumps over the lazy dog." @@ -20,8 +22,8 @@ def typing_speed_test(): print(f"It took you, {secs1:.2f} seconds!") print(f"Your accuracy: {accuracy1:.2f}%") - if secs1 < 10 and accuracy1 > 80: - print("You're ready for a harder challenge!") + if secs1 < 12 and accuracy1 > 60: + start = input("\nYou're ready for a harder challenge!\nPress 'enter' to start! ") print("\nvvv Type this sentence as fast as you can! vvv\n ----------------------------------------") print(f"{prompt2}\n ----------------------------------------") @@ -34,22 +36,22 @@ def typing_speed_test(): accuracy2 = accuracy_checker(prompt2, typed_response2) print(f"It took you, {secs2:.2f} seconds!") - print(f"Your accuracy: {accuracy2:.2f}%") + print(f"Your accuracy: {accuracy2:.2f}%\n Great job!") + else: print("\nNot too bad try again and get better results for a harder challenge!") def accuracy_checker(prompt:str, user_input:str): - correct_char = 0 - - prompt_strip = prompt.strip() - user_input_strip = user_input.strip() - - for i in range(min(len(prompt_strip), len(user_input_strip))): - if prompt_strip[i] == user_input_strip[i]: - correct_char += 1 + """ + Returns accuracy as the percentage of characters in the prompt + that match the user's input (position by position). + """ + prompt_words = prompt.strip().split() + user_words = user_input.strip().split() - accuracy = (correct_char / len(prompt)) * 100 + correct_words = sum(1 for p, u in zip(prompt_words, user_words) if p == u) + accuracy = (correct_words / len(prompt_words)) * 100 if len(prompt_words) > 0 else 0.0 return accuracy From 096a58bbaeab894d7103cab6508096cd45fe83e3 Mon Sep 17 00:00:00 2001 From: Kyleigh Date: Sat, 20 Sep 2025 00:29:36 -0500 Subject: [PATCH 13/13] Fix formatting --- week1_projects/KyleighHarkless/Typing_speed_tester.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/week1_projects/KyleighHarkless/Typing_speed_tester.py b/week1_projects/KyleighHarkless/Typing_speed_tester.py index ed00036..a979581 100644 --- a/week1_projects/KyleighHarkless/Typing_speed_tester.py +++ b/week1_projects/KyleighHarkless/Typing_speed_tester.py @@ -1,7 +1,7 @@ import time def typing_speed_test(): - start = input("Welcome to the typing test!\nPress 'enter' to start! ") + start = input("\nWelcome to the typing test!\nPress 'enter' to start! ") print("\nvvv Type this sentence as fast as you can! vvv\n ----------------------------------------")