Question: Question 2 ( 5 0 Points ) : Write a program that will take a string as user input. Now, write a Python code that
Question 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:
findSpaceString input : It will print the location of white spaces in the string
removeSpaceString 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 findSpaceString input method and print: "Whitespaces found at positions and Then it will invoke the removeSpaceString input method and print: "Haveaniceday!"
If the user inputs "Superman The findSpaceString input method prints: "Whitespaces not found in this string.", and the removeSpaceString input method prints: "Superman
You must test the following strings:
No White Space Here"
@@AddSpaceinThe
PWg
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
