diff --git a/README.md b/README.md deleted file mode 100644 index 678e321..0000000 --- a/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# LAB_FUNCTIONS_102 - -## Create a function : find_primes that takes in 2 parameters of type int , and print the prime numbers between the first parameter and the second parameter . - -### hint -a prime number i a number that is divisible only by itself and 1 (e.g. 2, 3, 5, 7, 11) -Also , you can think of it as A Prime Number is a number that cannot be made by multiplying other whole numbers - - -#### for example, primes between `25` and `50` are: -``` -29 -31 -37 -41 -43 -47 -``` - -# Bonus -## write a function that takes a string as a parameter -- first check that the type of the parameter is of type str -- then, it should separates the word at any capital letter and replace it with a small letter -- and should return the new modified string ! - -Example: `helloWorldThere` should return : -```hello world there``` diff --git a/lab_fun.py b/lab_fun.py new file mode 100644 index 0000000..3e3f29e --- /dev/null +++ b/lab_fun.py @@ -0,0 +1,20 @@ +def separate_capitals(text): + """ + This function checks if the parameter is a string. + Then it separates words at capital letters, + converts them to lowercase, + and returns the modified string. + """ + + if not isinstance(text, str): + return "Error: Parameter must be a string" + + result = "" + + for char in text: + if char.isupper(): + result += " " + char.lower() + else: + result += char + + return result.strip() \ No newline at end of file diff --git a/lab_fun.py ponus b/lab_fun.py ponus new file mode 100644 index 0000000..3e3f29e --- /dev/null +++ b/lab_fun.py ponus @@ -0,0 +1,20 @@ +def separate_capitals(text): + """ + This function checks if the parameter is a string. + Then it separates words at capital letters, + converts them to lowercase, + and returns the modified string. + """ + + if not isinstance(text, str): + return "Error: Parameter must be a string" + + result = "" + + for char in text: + if char.isupper(): + result += " " + char.lower() + else: + result += char + + return result.strip() \ No newline at end of file