title: Python: How to have a for loop print a randomly generated item in a list every time?
body: <p>EDIT: Random "for loop" output fixed. Now am receiving "list index out of range error".</p>
  
  <p>I am meant to be making a grading program that is based on randomly generated letter grades (A-F). The program asks for the amount of assignments and prints the assignment number with the letter grade. It should also find the average grade of the randomly generated grade. The output should look something like this:</p>
  
  <pre><code>Assignment 1 grade is an F
  Assignment 2 grade is a C
  Assignment 3 ...
  The average is a ...
  </code></pre>
  
  <p>I have a list set up to randomly generate the letter grade. I am having trouble setting code to find the average of the letter grades. Also, my loop does not spit out a new letter grade every time as it should. Here is some of my code:</p>
  
  <pre><code>numberlist = []
  numberlist.append("A")
  numberlist.append("B")
  numberlist.append("C")
  numberlist.append("D")
  numberlist.append("F")
  
  count = 1
  for i in range(total):
      numberindex = random.randint(0, 5)
      print("The grade for assignment", count, \
            "is a {}".format(numberlist[numberindex]))
      count = count + 1
  </code></pre>
  
  <p>It currently prints:</p>
  
  <pre><code>Assignment 1 grade is an F
  Assignment 2 grade is an F
  Assignment 3 grade is an F...
  </code></pre>