Question: HELP WITH THIS PYTHON PROGRAM PLEASE! Write a Python program that contains two functions: main function and search function The search function has two parameters:

HELP WITH THIS PYTHON PROGRAM PLEASE!  HELP WITH THIS PYTHON PROGRAM PLEASE! Write a Python program that

Write a Python program that contains two functions: main function and search function The search function has two parameters: my string and target. target is the substring to search for within my,string. The searching is implemented using the string object's find(substring) method. The search function should print the index of the first occurrence of the target substring if it is found: Otherwise (target does not exist in my string), print 'XX is not found' (KX is the target substring. Inside the main function: (1) create a string variable my string and assign 'Commputer#' to it; (2) use the rstrip(char) method to strip off the # on the right end of my, string, update and print my,string: (3) Call the upper) method to capitalize the lowercase letters in my,string, update and print my,string:(4) Call the replace(substring, new, substring) method to replace MM' with M; update and print my string: (5) Use the search function twice to search for 'C" and 'm, respectively After strip: Commputer After capitalization: COMMPUTER After replacement: cOMPUTER The index of C is 0 m is not found

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!