<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a simple assignment for school but am unsure where to go. The > assignment is to read in a text file, split out the words and say which > line each word appears in alphabetical order. I have the basic outline > of the program done which is: >
And in general, this is one of the best "can anyone help me with my homework?" posts I've ever seen. A. You told us up front that it was your homework. B. You made an honest stab at the solution before posting, and posted the actual code. C. You ended with some specific questions on things that didn't work or that you wanted to improve. Your current program looks like at least A- material. Add use of sorted and enumerate, and handle that exception a little better, and you're getting into A+ territory. Out of curiosity, what school are you attending that is teaching Python, and under what course of study? -- Paul -- http://mail.python.org/mailman/listinfo/python-list