title: Python Logic Issue: Test Scores
body: <p>Hi all I'm a bit stuck with a logic problem.</p>
  
  <p>The criteria is:</p>
  
  <p>Write a program that asks the user to enter a number of test scores. The program should display a letter grade for each score and the average test score. Write the following functions in the program:</p>
  
  <p>calc_average - This function should ask the user to enter in test scores until there are no more scores to enter, print the letter grade for each test score, and return the average of all test scores.
  determine_grade - This function should accept a test score as an argument and return a letter grade for the score, based upon the following grading scale:</p>
  
  <p>Score Scale:</p>
  
  <p>90 - 100 A
  80 - 89 B
  70 - 79 C
  60 - 69 D
  Below 60 F</p>
  
  <p>So the way I'm thinking about it is that I would have to create two functions calc_average and determine_grade.</p>
  
  <p>The problem is that by having determine_grade() above calc_average() the score once entered from calc_average() can not be passed up to determine_grade() and so the letter grade can not be determined and be passed back down to be printed. So the problem becomes seemingly unsolvable (at least if one follows the instructions).</p>
  
  <p>Please help me find a solution. Thanks </p>
  
  <p>My code so far (not yet complete):</p>
  
  <pre><code>def determine_grade(grade):
  
      while 90 &lt;= grade &lt;= 100:
          g = "A"
      while 80 &lt;= grade &lt;= 89:
          g = "B"
      while 70 &lt;= grade &lt;= 79:
          g = "C"
      while 60 &lt;= grade &lt;= 69:
          g = "D"
      while grade &lt; 60:
          g = "F"
      return g
  
  def calc_average():
  
      c = "y"
      t = 0
      count = 0
      while c == "y" or c == "Y":
          s = float(input("Enter score: "))
          t +=s 
          count += 1
          g = determine_grade(s)
          print("Grade: " .format(g))
          avg = t/count
      return avg
  
  a = calc_average()
  print("Average: {0:.2f}" .format(a))
  </code></pre>