Sending A Letter


#1



I am not stuck on this specific exercise, as I ended up figuring out what the issue was, but I would like to understand why the addition of the specific line below was causing problems with my code.


In adding in the line underneath where I defined the function, I assumed this would tell the computer what the value of score was supposed to be so that it understood where to get the values from. But upon running the program it told me that the score of 100 was being assigned the value of "C." What did that one line of code change about the function so that it would think that a score of 100 was a "C?"

Thank you for your time


def get_letter_grade(score):
score = get_average(student)
    if score >= 90:
        return "A"
    elif score >= 80:
        return "B"
    elif score >= 70:
        return "C"
    elif score >= 60:
        return "D"
    else:
        return "F"
print get_letter_grade(get_average(lloyd))


#2

A function receives the data it should act on when it is called through its parameters. It's not supposed to go out and find that information itself.

If I have a function that adds two numbers, then I need to tell it which two numbers to add, how would it know where to look for the numbers I want to add? It doesn't, so any attempt at doing so has nothing to do with what the function is supposed to do.