I've been chatting with Albertito on MSN and came up with this solution: int(x), and change student into student ids, and remove #Max. Will this work, or will I need to add sequential IDs? ----- Original Message ----- From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Yoo, Danny" <[EMAIL PROTECTED]>; "Bark, Adam" <[EMAIL PROTECTED]> Cc: "Tutor" <tutor@python.org> Sent: Tuesday, August 02, 2005 1:43 AM Subject: Re: [Tutor] I've run into a jam on the exercise on file I/O
> >> What if I were to use ID's for the students and use the ID's as the >> sequence >> index, and link the students and their grades to the IDs? > > Its not necessary for what you are doing but it's how you'd normally do it > in a relational database, so if you ever needed to turn your file based > program into a full blown database then using IDs would actually help! > > The other thing you could do is hold all the data for a single student > in one structure. Thus instead of having lots of lists all linked by > a common index (or ID) you have one collection of students (probably > a dictionary keyed by name) each with all of its own data. This > involves a more complex data structure and is a move in the direction > of object oriented programming but without actual classes and objects > being involved. This might also allow you to use the shelve moduile > to save/restore your data to file easily. > > Just a thought, > > Alan G. > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor