Question: Question 2 ( 5 0 Points ) : Write a program that will take a string as user input. Now, write a Python code that

Question 2(50 Points): Write a program that will take a string as user input. Now, write a Python code that will print all the positions of white spaces in the given string and print the modified string after removing all the whitespaces. You must write the following two functions:
findSpace(String input) : It will print the location of white spaces in the string
removeSpace(String input). It will print the modified string after removing all the whitespaces.
For example, if the user inputs "Have a nice day!" It will invoke the findSpace(String input) method and print: "Whitespaces found at positions 4,6, and 11." Then it will invoke the removeSpace(String input) method and print: "Haveaniceday!"
If the user inputs "Superman-12455" The findSpace(String input) method prints: "Whitespaces not found in this string.", and the removeSpace(String input) method prints: "Superman-12455"
You must test the following strings:
"No White Space Here"
"@@Add1Space_inThe_"
_-00_P_8_Wg"
 Question 2(50 Points): Write a program that will take a string

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!