Nov-26-2018, 02:13 AM
You are running all code in interactive shell(>>>).
You need to open a New File window,look at this .
Then whole code need to be without
You save eg
You need to open a New File window,look at this .
Then whole code need to be without
>>>
.You save eg
grades.py
and Run with F5.counter = 0 PassCounter = 0 FailCounter = 0 Average = 0 #This function does the calculations def Calc(): MidGrade = int(input("Your mid-term grade is: ")) print (str(MidGrade) + "%") FinGrade = int(input("Your Final grade is: ")) print (str(FinGrade) + "%") WeightedMid = MidGrade*.4 WeightedFin = FinGrade*.6 global Average Average = WeightedMid + WeightedFin #This function outputs the necessary information def Output(): print ("Your Average is: " + str(Average) + "%") counter = + 1 if Average > 59.99: print ("You have passed the course!") global PassCounter PassCounter = + 1 else: print ("You have failed the course.") global FailCounter FailCounter = + 1 print ("Number of grades calculated: " + str(counter)) print ("Number of students who have passed: " + str(PassCounter)) print ("Number of students who have failed: " + str(FailCounter)) print (Calc()) print (Output())I may come back with suggestion to fix stuff that are not good in this code.