diff --git a/Lab_solution.py b/Lab_solution.py new file mode 100644 index 0000000..5135391 --- /dev/null +++ b/Lab_solution.py @@ -0,0 +1,13 @@ +def find_primes(number1: int, number2: int): + for n in range(number1, number2 + 1): + if n < 2: + continue + is_prime = True + for n2 in range(2, int(n ** 0.5) + 1): + if n % n2 == 0: + is_prime = False + break + if is_prime: + print(n) + +find_primes(25, 50) \ No newline at end of file diff --git a/bonus.py b/bonus.py new file mode 100644 index 0000000..9e27acd --- /dev/null +++ b/bonus.py @@ -0,0 +1,16 @@ +def separates_word (word:str): + if not word.isalpha(): + return "Please enter letters only" + + result = "" + + for char in word: + if char.isupper(): + result += " " + char.lower() + else: + result += char + + return result.strip() + +input_user=input("Type what you want: ") +print(separates_word(input_user)) \ No newline at end of file