Question: Write a Python function, called NoSpaces( ), that takes in a string as a parameter and returns the string re-written without any space characters. For
Write a Python function, called NoSpaces( ), that takes in a string as a parameter and returns the string re-written without any space characters. For example: NoSpaces(I still havent found what Im looking for) returns the string: IstillhaventfoundwhatImlookingfor Hint: use a for loop to go through each character in the sentence, like in the example of Listing 3.2 in the book (p. 95)
Write a generalizable Python function based on NoSpaces( ) from the previous question, called NoChar( ), that takes in 2 parameters: a string and a character. It returns the string without any of the character in it. For example: NoChar(Id rather be a hammer than a nail, a) returns the string: Id rther be hmmer thn nil
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
