Question: I am having an issue finishing out this last function. I have other functions within my application. I select number 1, for one function, number

I am having an issue finishing out this last function. I have other functions within my application. I select number 1, for one function, number 2 for another one but I am having issues ending the last one here and was hoping someone could provide some guidance.

def main(): """ """

def compute__gpa(grades): if (grades== "A"): return 16.0; elif (grades== "B"): return 12.0; elif (grades== "C"): return 8.0; elif (grades== "D"): return 4.0; else: return 0.0; def run(): Math = str(input("Enter your Math letter grade: ")) courseCredit = float(4) print(f"Grade point for course 1 is {compute__gpa(Math)}.") English = str(input("Enter your English letter grade: ")) courseCredit2 = float(4) print(f"Grade point for course 2 is {compute__gpa(English)}.") Science = str(input("Enter your Science letter grade: ")) courseCredit3 = float(4) print(f"Grade point for course 3 is {compute__gpa(Science)}.")

GPA = ((compute__gpa(Math) * courseCredit) + (compute__gpa(English) * courseCredit2) + (compute__gpa(Science) * courseCredit3)) / (courseCredit + courseCredit2 + courseCredit3)/4

print(f"Your GPA is: {str(GPA)}")

#if __name__ == "__main__": #run()

try: main() except SystemExit: print("Exiting...")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!