title: Test Average and Grade - Python
body: <p>I am trying to create a python program which when you enter 5 test scores it displays the corresponding letter grade and then gets the average of those five grade and displays the letter grade for the average.  </p>
  
  <p>Here's my program:</p>
  
  <pre><code>#Test Average and Grade
  
  #Enter 5 test scores
  test1 = int(input('Enter score 1: '))
  test2 = int(input('Enter score 2: '))
  test3 = int(input('Enter score 3: '))
  test4 = int(input('Enter score 4: '))
  test5 = int(input('Enter score 5: '))
  
  total =(test1 + test2 + test3 + test4 + test5)
  
  #Calculate average
  def calc_average(total):
      return total / 5
  
  #Grading scale
  def determine_score(grade):
      if 90 &lt;= grade &lt;= 100:
          return 'A'
      elif 80 &lt;= grade &lt;= 89:
          return 'B'
      elif 70 &lt;= grade &lt;= 79:
          return 'C'
      elif 60 &lt;= grade &lt;= 69:
          return 'D'
      else:
          return 'F'
  
  
  grade = total
  avg = calc_average(total)
  abc_grade = determine_score(grade)
  
  print("That's a(n): " + str(abc_grade))
  print('Average grade is: ' + str(avg))
  </code></pre>
  
  <p>The problem I'm having is that I can't get the grade to display after each score that is entered and I am having trouble trying to figure out how to get the letter grade to display along with the average in the last statement.  Any help would be greatly appreciated. </p>
  
  <p>Changed program to this:</p>
  
  <pre><code> #Test Average and Grade
  
  #Enter 5 test scores
  test1 = int(input('Enter score 1: '))
  test2 = int(input('Enter score 2: '))
  test3 = int(input('Enter score 3: '))
  test4 = int(input('Enter score 4: '))
  test5 = int(input('Enter score 5: '))
  
  total =(test1 + test2 + test3 + test4 + test5)
  
      #Calculate average
      def calc_average(total):
          return total / 5
  
      #Grading scale
      def determine_score(grade):
          if 90 &lt;= grade &lt;= 100:
              return 'A'
          elif 80 &lt;= grade &lt;= 89:
              return 'B'
          elif 70 &lt;= grade &lt;= 79:
              return 'C'
          elif 60 &lt;= grade &lt;= 69:
              return 'D'
          else:
              return 'F'
  
      grade = total
      avg = calc_average(total)
      abc_grade = determine_score(grade)
  
      print("Score 1:", determine_score(test1)) 
      print("Score 2:", determine_score(test2)) 
      print("Score 3:", determine_score(test3)) 
      print("Score 4:", determine_score(test4)) 
      print("Score 5:", determine_score(test5)) 
      print("The average grade is: %s which is a(n): %s " % (str(avg), abc_grade))
  </code></pre>
  
  <p>Results look this this:</p>
  
  <p>Enter score 1: 75
  Enter score 2: 80
  Enter score 3: 33
  Enter score 4: 90
  Enter score 5: 52
  Score 1: C
  Score 2: B
  Score 3: F
  Score 4: A
  Score 5: F
  The average grade is: 66.0 which is a(n): F </p>
  
  <p>Trying to get the results like this:
  Enter score 1: 75
  That's a(n): C
  Enter score 2: 80
  That's a(n): B
  Enter score 3: 33
  That's a(n): C
  Enter score 4: 90
  That's a(n): A
  Enter score 5: 52
  That's a(n): F
  The average grade is: 66.0 which is a(n): F</p>