Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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! image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

Students also viewed these Databases questions

Question

What are some of the challenges integrated reporting must overcome?

Answered: 1 week ago

Question

Why is it expensive for a firm to grow?

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago