Recent joiner and first-time poster, so please bear with me and let me know if I’m not posting in the correct place !
I’m having an issue with the exercise [Else If statements]
My code below:
grade = gpa
if gpa >= 4.0:
elif gpa >= 3.0:
elif gpa >= 2.0:
elif gpa >= 1.0:
elif gpa >= 0.0:
When running the code, the output is technically correct as it prints out the correct grade letter depending on the input value (“A” in this example) but it also prints out the actual GPA value from my argument (here 4.1), as below
I also gets this message when running the code:
It looks like your function didn’t convert the grades correctly. 4.1 should return the letter grade A, but instead it returned 4.1.
Could someone explain what I’m doing wrong ? The solution starts by defining the variable grade as “F”, which I don’t understand…
Thanks for your help !