If you carefully re-read my initial post, you will notice that the steps 5 and 6 are only executed when the input file has been fully processed. In your code, the
Second hint: you sort elements of the tuple itself -- (123456789, "John Doe", "Math") -- is this really what you want?
for
loop includes some sorting and output file writing...Second hint: you sort elements of the tuple itself -- (123456789, "John Doe", "Math") -- is this really what you want?