title: How to print dictionary keys and values in python
body: <p>I have to make a program which asks the user to enter a student name, and their grade, for every student. And put them as [keys] and [values] in a dictionary. And when the user enters 'q' the program quits and then prints the students and their grades such as this:</p>
  
  <p><code>Student      Grade</code><br>
  <code>Student1      A</code><br> 
  <code>Student2      B</code><br>
  <code>Student3      C</code><br></p>
  
  <p>My code looks like this:</p>
  
  <pre><code>student_grades = {}
  
  while True:
  
      ## Get the Name [key in dictionary] of the student
      name = raw_input("Please give me the name of the student (press q to quit): \n")
  
      if name == 'q':
          print "Okay, printing grades! \n"
          for x in student_grades:
              print student_grades.keys() + student_grades.values()
          break
  
      # Chcek if name isn't valid
      elif name.isdigit():
          print "Sorry, {} isn't valid".format(name)
          name = raw_input("Please give me the name of the student (press q to quit): \n")
  
      ## Get the grade [value in dictionary] of the student
      grade = raw_input("Please give me their grade: (e.g 'A', 'B', 'C', 'D', 'F') \n")
  
      # Check if grade isn't valid
      if not grade in ['A', 'B', 'C', 'D', 'F']:
          print "Sorry, {} isn't valid".format(grade)
          grade = raw_input("Please give me their grade: (e.g 'A', 'B', 'C', 'D', 'F') \n")
          # Assign Name to Grade
          student_grades[name] = grade
  </code></pre>
  
  <p>When I enter 'q' the program should print the keys and values which are the student name and their grade, but it prints nothing</p>