Question: 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

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

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!