From 0d233a891c85c91cd0014b100666e6932322e74c Mon Sep 17 00:00:00 2001 From: Atheer Alharthi Date: Sun, 22 Feb 2026 21:19:55 +0300 Subject: [PATCH] Lap functions and bonus --- Bonus.py | 12 ++++++++++++ LAB_FUNCTIONS_102.py | 15 +++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Bonus.py create mode 100644 LAB_FUNCTIONS_102.py diff --git a/Bonus.py b/Bonus.py new file mode 100644 index 0000000..ca15343 --- /dev/null +++ b/Bonus.py @@ -0,0 +1,12 @@ +def split_camel_case(text): + if not isinstance(text, str): + return "Error: Input must be a string" + + result = "" + for char in text: + if char.isupper(): + result += " " + char.lower() + else: + result += char + return result.strip() +print(split_camel_case("helloWorldThere")) diff --git a/LAB_FUNCTIONS_102.py b/LAB_FUNCTIONS_102.py new file mode 100644 index 0000000..a83420f --- /dev/null +++ b/LAB_FUNCTIONS_102.py @@ -0,0 +1,15 @@ +def find_primes(start, end): + for num in range(start, end + 1): + if num > 1: # primes are greater than 1 + is_prime = True + for i in range(2, int(num ** 0.5) + 1): + if num % i == 0: + is_prime = False + break + if is_prime: + print(num) +find_primes(2, 10) + + + +