Question: What would be a good pseudocode for this code? file = open('C:Python34unsorted_fruits.txt','r') outfile=open('C:Python34sorted_fruits.txt','w') #readlines return a list fruits=file.readlines() #list.sort() do an inline sort fruits.sort() #remove

What would be a good pseudocode for this code?

file = open('C:\Python34\unsorted_fruits.txt','r') outfile=open('C:\Python34\sorted_fruits.txt','w')

#readlines return a list fruits=file.readlines()

#list.sort() do an inline sort fruits.sort()

#remove the blank lines and write the file for fruit in fruits: if fruit != ' ': #if fruit is blank, skip the write outfile.write(fruits) #otherwise write the fruit to the output file outfile.write(" ") #close the input and output file file.close() outfile.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!