class Student(): def __init__(self, _name, _year): self.name = _name self.year = _year def __str__(self): return "{}, class of {}".format(self.name, self.year) students = [] more = 'm' while(more != 'y' and more != 'n'): more = raw_input('Would you like to enter student information?(y/n) ') while (more == 'y'): name = raw_input('What is their name? ' ) year = raw_input('What is their year? ' ) s = Student(name, year) print "You added information for the following student:\n\t{}".format(s) students.append(s) more = 'm' while(more != 'y' and more != 'n'): more = raw_input('Would you like to enter student information?(y/n) ') print "\nHere's all the students that you listed:" for s in students: print "\t{}".format(s)