title: I can't let the data to remain in the dictionary, it keeps updating instead
body: <p>I got myself a python book. Currently, in the book, I am learning about dictionaries. The book gave me an exercise about dictionaries. This is the question.</p>
  <p>&quot;Create a program that pairs student's name to his class grade. The user should be able to enter as many students as needed and then get a printout of all students' names and grades. The output should look like this:</p>
  <blockquote>
  <p>Please give me the name of the student (q to quit): [input]</p>
  </blockquote>
  <blockquote>
  <p>Please give me their grade: [input]</p>
  </blockquote>
  <blockquote>
  <p>[And so on...]</p>
  </blockquote>
  <blockquote>
  <p>Please give me the name of the student (q to quit): [input]: q</p>
  </blockquote>
  <blockquote>
  <p>Okay, printing grades!</p>
  </blockquote>
  <blockquote>
  <p>Student     Grade</p>
  </blockquote>
  <blockquote>
  <p>Student1      A</p>
  </blockquote>
  <blockquote>
  <p>Student2      B</p>
  </blockquote>
  <blockquote>
  <p>[And so on...] &quot;</p>
  </blockquote>
  <pre><code>def student():
      studentmarks = {}
      while True:
          name = raw_input(&quot;Please give me the name of the student ('q' to quit):&quot;)
          if name == &quot;q&quot;:
              break
          elif name.isalpha() == True:
              grade = raw_input(&quot;Please give me their grade ('q' to quit):&quot;)
              if grade == &quot;q&quot;:
                  break
              elif grade.isalpha() == True:
                  print &quot;Grade is a number! Please try again&quot;
                  continue
              elif grade.isdigit() == True:
                  studentmarks = {name: grade}
              else:
                  print &quot;Error, please try again&quot;
                  continue
          else:
              print &quot;Please try again. {} is not the right input&quot;.format(name)
              continue
          print studentmarks
          continue
  student()
  </code></pre>
  <p>I modified the code a bit to test the dictionary. I also use python 2</p>