Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is using python original is like this Weather the whether be fine, Or weather the whether be not. Weather the whether be cold, Or
This is using python
original is like this
Weather the whether be fine, Or weather the whether be not. Weather the whether be cold, Or weather the whether be hot. We'll whether the whether, Whatever the whether, Weather we like it or not.
so i want it print like this
Whether the weather be fine, Or whether the weather be not. Whether the weather be cold, Or whether the weather be hot. We'll weather the weather, Whatever the weather, Whether we like it or not.
instead it print like this what is wrong i think i did it correctly
Whether the the be fine, Or whether the the be not. Weather the the be cold, Or whether the the be hot. We'll hot. We'll the whether, Whatever the whether, Weather we like it or not.
f1 = open("weather.txt', 'r')#this will not load t t2 = open(newtext.txt','w') data = f1.read()#now we have read all the text in newtext "" swap "" textin = data, split(' ') for word in textin: if word == "weather": elif word =- "Weather". elif word == "whether". elif word"Whether": else: swap word . replace("weather", "whether") = swap word. replace("Weather", "Whether") = word.replace( "whether", "weather") word.replace("Whether", "Weather") swap word net ext += swap + print (swap) print (newtext)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started