Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pySure/README.md
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions pySure/temp.py
Original file line number Diff line number Diff line change
@@ -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()

Expand All @@ -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":
Expand Down
23 changes: 23 additions & 0 deletions week1_projects/KyleighHarkless/README.md
Original file line number Diff line number Diff line change
@@ -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
58 changes: 58 additions & 0 deletions week1_projects/KyleighHarkless/Typing_speed_tester.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import time

def typing_speed_test():
start = input("\nWelcome 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."
prompt2 = "Despite the heavy rain, Julia sprinted across the crowded street—dodging cars, " \
"splashing through puddles, and laughing the entire way."

print(f"{prompt1}\n ----------------------------------------\n")

start1 = time.time()
typed_response1 = input(">>> ")
end1 = time.time()

secs1 = (end1 - start1)

accuracy1 = accuracy_checker(prompt1, typed_response1)

print(f"It took you, {secs1:.2f} seconds!")
print(f"Your accuracy: {accuracy1:.2f}%")

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 ----------------------------------------")

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}%\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):
"""
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()

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

typing_speed_test()