title: Edhesive 7.5 code practice GPA average Python
body: <p>Currently my code is:</p>
  <pre><code>def GPAcalc(grade, weighted):
     grade = grade.lower()
     dictionary = {&quot;a&quot;: 4, &quot;b&quot;: 3, &quot;c&quot;: 2, &quot;d&quot;: 1, &quot;f&quot;: 0}
     if weighted == 1 and grade in dictionary:
         return &quot;Your GPA score is: &quot;+str(dictionary[grade] + 1)
       
     elif weighted == 0 and grade in dictionary:
         return &quot;Your GPA score is: &quot;+str(dictionary[grade])
     else:
         return &quot;Invalid&quot;
  
  def GPAav():
      grade = GPAcalc()
      for i in range(0,cl):
          grad= GPAcalc(grade,dictionary)
          total = grade + total
          print(total/cl)
  cl = int(input(&quot;How many Classes are you taking? &quot;))
  for i in range(0,cl):
      print(GPAcalc(input(&quot;Enter your letter Grade: &quot;), int(input(&quot;Is it weighted?(1= yes, 0= no) &quot;))))
  GPAav()
  </code></pre>
  <p>I have to find the average GPA in decimal form from the rest of the code and output it. How would I go about getting the values from GPAcalc and using it in GPAav so i can average it out?</p>