Question: PYTHON What do I have to add to this programm so that it reads a file word by word and sorts the words alphabetically in

PYTHON

What do I have to add to this programm so that it reads a file word by word and sorts the words alphabetically in a new file (each word in the new file must be in a different line).

PYTHON What do I have to add to this programm so that

origin = open(input("Text file of origin:"),"r") newfile = open(input("Nex text file with the words sorted :"), "w") for line in origin: for word in line.split(): newfile.write(word) newfile.close() origin.close()

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!