7/9 [spoilers] testing function?



<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>


print get_average(lloyd)

<do not remove the three backticks above>

This exercise calls for the following:
"Print the resulting letter grade with print. Call the get_letter_grade function and pass in get_average(lloyd)."

The answer is code above.  Are we not calling the function?


it seems the solution does not including calling get_letter_grade, how could we do this?


I would resolve by calling both independently:

print get_letter_grade(lloyd)
print get_average(lloyd)

I was not sure what was meant by the exercise prompt: “Call the get_letter_grade function and pass in get_average(lloyd)”.

What does “pass in” in particular refer to? I couldn’t find relationship to the correct solution.


but that won’t work, given get_letter_grade is only capable of converting a number grade to a letter grade, here:

print get_letter_grade(lloyd)

lloyd is not a number grade.

we pass in arguments at function call, for example here:

print get_letter_grade(lloyd)

we pass in lloyd as argument to get_letter_grade

to get this to work, we need to pass get_average(lloyd) into get_letter_grade

you could insert an additional step, call get_average with argument lloyd to get lloyd his (her? no idea xD) number grade, and store this in a variable, then pass this variable to get_letter_grade


Which we did by defining the prior function. Understood, thank you!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.