Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write code that takes two strings from the user, replaces all instances of the second string with box in the first, and return this in

Write code that takes two strings from the user, replaces all instances of the second string with box in the first, and return this in BACKWARDS order. For example, yppahmondayyppahday and happy yields the result yadboxyadnombox. We will guarantee the second string will be less than four characters long. You may not use the built-in replace function. Please use PYTHON 2.7, and your answer MUST be a WHILE loop and NOT a "for" loop!

Here is the link to the python visualizer for the code I have so far, feel free to modify as needed.

https://goo.gl/VjEhcD

Here are the test cases that it MUST pass!

replaceAll bird c drib replaceAll bird i drboxb replaceAll bird ri dboxb replaceAll birdird ri dboxboxb replaceAll birdeeeirde dri eboxeeeboxb replaceAll birdeeeirede dri ederieeeboxb 

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

Students also viewed these Databases questions

Question

Can organizations execute an unlimited number of projects? Why?

Answered: 1 week ago