From 4937c519fa2fbaa4ceb5723f93cd5e883c8b6d61 Mon Sep 17 00:00:00 2001 From: EntropicDecay Date: Mon, 29 Apr 2024 19:14:53 -0500 Subject: [PATCH] idk what we edited Co-authored-by: seaswimmerthefsh@gmail.com --- division/README.md | 5 +++++ division/main.py | 12 +++++++----- online_store/README.md | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 division/README.md diff --git a/division/README.md b/division/README.md new file mode 100644 index 0000000..5b1975e --- /dev/null +++ b/division/README.md @@ -0,0 +1,5 @@ +# Division + +## 04/29/2024 + +wip diff --git a/division/main.py b/division/main.py index b8b29bf..eed5dfc 100644 --- a/division/main.py +++ b/division/main.py @@ -2,7 +2,8 @@ BLUE = "\033[34m" # Blue RED = "\033[31m" # Red GREEN = "\033[32m" # Green -RESET = "\033[0m" # Reset to default color +RESET = "\033[0m" # Reset to default color + def divide(x: float, y: float) -> float | None: try: @@ -12,12 +13,13 @@ def divide(x: float, y: float) -> float | None: return print(f"{RED}You cannot divide by strings!{RESET}") if y == 0: - return print(f"{RED}You cannot divide by 0!{RESET}") # you don't divide by zero - return float(x/y) + return print(f"{RED}You cannot divide by 0!{RESET}") # you don't divide by zero + return float(x / y) + if __name__ == "__main__": x = input(f"{BLUE}Input a number to divide:{RESET} ") y = input(f"{BLUE}Input a number to divide by:{RESET} ") - result = divide(x,y) + result = divide(x, y) if result is not None: - print(f"{GREEN}{result}{RESET}") \ No newline at end of file + print(f"{GREEN}{result}{RESET}") diff --git a/online_store/README.md b/online_store/README.md index 7426c80..fa99cc6 100644 --- a/online_store/README.md +++ b/online_store/README.md @@ -1,5 +1,5 @@ # Online Store -## 04/29/2024 +## 04/26/2024 wip