Feb-18-2019, 09:25 PM
First of all, I am very new so I apologize if this is a stupid question or if it requires a simple fix.
My goal was to create a function that returns and prints the grade associated with a number given to the code. For example, you put in 65, it prints "The grade for 65 is A" (Ik that's not how it works in schools). So I'm not sure what I did wrong here, if someone could point me in the right direction that would be very helpful.
My goal was to create a function that returns and prints the grade associated with a number given to the code. For example, you put in 65, it prints "The grade for 65 is A" (Ik that's not how it works in schools). So I'm not sure what I did wrong here, if someone could point me in the right direction that would be very helpful.
mrk = 3 grade = returnGrade(mrk) print("The grade is",grade) def returnGrade(mrk): “””return grade “”” if mark >= 65: grade = "First" elif dnum <= 64: grade = "Upper Second" elif dnum <= 60: grade = "Second" elif dnum <= 50: grade = "Third" return grade else: grade = "ERROR"