title: Going through list from class in python
body: <p>For a school project I have to write a python program that records student records and display them.  </p>
  
  <p>My school said she wanted a class that represents the school register but I don't know understand how I do that.</p>
  
  <p>I created the following:</p>
  
  <pre><code>class SchoolRegister:
  
      def __init__(self):
          ListOfPupils = {}
  
      def REgisterPupil(self, lastname, firstname, schoolID):
          ListOfPupils[schoolID] = (lastname, firstname)
  
   sr = SchoolRegister()
   sr.REgisterPupil("Thomas", "Lucy", 1)
   sr.REgisterPupil("Percival", "Jenny", 2)
  </code></pre>
  
  <p>I would like to be go through list so I get list out:
  1, Thomas, Lucy
  2, Percival, Jenny</p>
  
  <p>I searched and found a way of making class act as pupil list thingy, so I can do a for bod in sr but I don't understand it :(</p>