Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started