Write a program that reads from standard in three things: a word to find, a word...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that reads from standard in three things: a word to find, a word to replace with, and single line of text to perform the find-replace on. The program should output the three things, as well as, the line after performing the find and replace. For the input: cat dog My favorite animal is the cat. The output should be: Find Word: "cat" Replace Word: "dog" Pre Line: "My favorite animal is the cat." Post Line: "My favorite animal is the dog." Write a program that reads from standard in three things: a word to find, a word to replace with, and single line of text to perform the find-replace on. The program should output the three things, as well as, the line after performing the find and replace. For the input: cat dog My favorite animal is the cat. The output should be: Find Word: "cat" Replace Word: "dog" Pre Line: "My favorite animal is the cat." Post Line: "My favorite animal is the dog."
Expert Answer:
Answer rating: 100% (QA)
here is the solution to the problem Python def findandreplacefindword replaceword text Split the tex... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Workopolis and Monster are: web browsers. career interest surveys. Internet services firms can use to recruit employees. magazines that list job opportunities by skill requirements and geographic...
-
In Exercises show that the function y = (x) is a solution of the differential equation. y = 4e-x y" - y = 0
-
What is the rationale behind the NPV method? According to NPV, which franchise or franchises should be accepted if they are independent mutually exclusive?
-
Stevens (1966), citing Dimmick and Hubbard (1939), reported data from 20 studies of the color perception of unitary hues. The wavelength (in millimeters) of light called green by subjects in each...
-
True or False: If \(\operatorname{IRR}(\mathrm{A})>\operatorname{IRR}(\mathrm{B})\), then \(\operatorname{ERR}(\mathrm{A})>\operatorname{ERR}(\mathrm{B})\).
-
The Solo Hotel opened for business on May 1, 2014. Here is its trial balance before adjustment on May 31 Other data: 1. Insurance expires at the rate of $450 per month. 2. A count of supplies shows...
-
8) You own San Antonio's top rated food truck that sells the best carne asada tacos (good A) but the burger food truck (good B) next door just started a promotional sale: The burger truck...
-
On January 1, 2024, Perry Company purchased 8,000 shares of Soho Companys common stock for $120,000. Immediately after the stock acquisition, the statements of financial position of Perry and Soho...
-
Kameela Inc has $ 3,000,000 (par value), 8% convertible bonds outstanding . bond is convertible into thirty no par value common shares . The bonds pay inter anuary 31 and July 31. On July 31, 2020,...
-
Manipulating CAPM Use the basic equation for the capital asset pricing model (CAPM) to work each of the following problems a. Find the required return for an asset with a beta of 1.92 when the...
-
Need help in designing a blueprint for best buy in office furniture category and discuss the following items as well as an integration of these items that would support your company's business...
-
Identify a service and be prepared to present how COVID-19 is affecting (or has affected) a service in relation to services marketing. Need to be staying up with current news and trends. The answers...
-
Find the future values of these ordinary annuities. Compounding occurs once a year. Do not round intermediate calculations. Round your answers to the nearest cent. a. $200 per year for 14 years at...
-
Create a function named divide, which has the following details: It needs to receive 2 parameters. The first parameter should be divided by the second one. The function should return the result...
-
List and briefly explain five strategic supply chain practices that facilitated DHL to be coming successful.
-
You are standing on the top of a building and throw a ball vertically upward. After 2 seconds, the ball passes you on the way down, and 2 seconds after that, it hits the ground below. a. What is the...
-
What is the length of a contention slot in CSMA/CD for (a) A 2-km twin-lead cable (signal propagation speed is 82% of the signal propagation speed in vacuum)?, (b) A 40-km multi mode fiber optic...
-
In Fig. 7-22, www.aportal.com keeps track of user preferences in a cookie. A disadvantage of this scheme is that cookies are limited to 4 KB, so if the preferences are extensive, for example, many...
-
You are given a text file of size 60 MB, which is to be encrypted using steganography in the low-order bits of each color in an image file. What size image would be required in order to encrypt the...
-
The things that might lead a person to quit might not be the same things that lead a person to stay with an organization. For example, another job offer or the tendency to always be looking for new...
-
Divide the team into three groups. Each group will choose value, brand, or retention equity. Or, if team sizes are smaller, each team will select an equity component. For each equity component,...
-
Generate survey or interview items that would capture value-, brand-, or retention-equity levels in workers. If possible, ask a sample of your friends and neighbors to take a survey based on your...
Study smarter with the SolutionInn App