diff --git a/q1.py b/q1.py new file mode 100644 index 0000000..9e8eafa --- /dev/null +++ b/q1.py @@ -0,0 +1,10 @@ +def find_primes(num1:int, num2:int): + for x in range(num1, num2 + 1): + if x > 1: + for i in range(2, x): + if (x % i) == 0: + break + else: + print(x) +find_primes(25, 50) + diff --git a/q2.py b/q2.py new file mode 100644 index 0000000..72c643f --- /dev/null +++ b/q2.py @@ -0,0 +1,15 @@ + +def separate_words(word:str): + if type(word)==str: + result = "" + for char in word: + if char.isupper(): + result += " " + char.lower() + else: + result += char + return result.strip() + else: + return "not string" + + +print(separate_words("helloWorldThere ")) \ No newline at end of file