How can I test my get_letter_grade function?


#1

Question

How can I test my get_letter_grade function?

Answer

First, be sure you print your function test outside of any other functions, otherwise it won’t print when you Run your code because it’ll be inside of a function!
So once you’ve got your print statement outside of any functions, totally unindented, you write out your function name, get_letter_grade(). Now we’re ready to pass it a value.
Unlike we’ve usually done up to this point, we’re going to pass our function another function call as an argument! We can do this because get_average() returns a number, so it’s equivalent to passing a value in normally.
We should end up with something like print function_name(other_function(student_name)).


FAQ: Learn Python: Student Becomes the Teacher - Sending a Letter