Question: Question 1 100 pts Write a Python program that contains two functions: main function and search function. Inside the main function: (1) create a string

 Question 1 100 pts Write a Python program that contains two

Question 1 100 pts Write a Python program that contains two functions: main function and search function. Inside the main function: (1) create a string variable my-string and assign .. 1aB2cA3# to it; (2) using the strip-related methods to strip off the '*' on the left end and the on the right end of my_string, update and print my_string (3) Call the proper method to capitalize the lowercase letters of my string, again update and print my_string; (4) Call search function twice to search for 'A' and 'c, respectively. The search function has two parameters: my_string and target. target is the substring to search for within my string. Find method will be used to return the index of the first occurrence of the substring, if it is found: Otherwise (target does not exit in my_string) print 'XX is not found: XX is the target substring passed in. After strip: 1aB2cA3 After capitalization: 1AB2CA3 The index of A is 1 c 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!