I am trying to read a file and I am printing the content out in alphabetical order. it is only reading 6 items from the file and no more. I am not asking someone to do it for me , if someone can just guide me in the direction of what I am doing wrong here is my code so far.
infile = open("unsorted_fruits.txt", "r")
outfile=open("sorted_fruits.txt","w")
fruit=infile.read(50).split()
#outfile.write(fruit)
fruit.sort()
for numbers in range(len(fruit)):
print(fruit[numbers])
infile.close()
outfile.close()