Code works but nothing displays in the output monitor


When I run this code I get a message saying the code was successful however the class average is not being displayed in the output screen. Instead the output screen says None.

Shouldn't the class average be displayed when the code works?

lloyd = {
    "name": "Lloyd",
    "homework": [90.0, 97.0, 75.0, 92.0],
    "quizzes": [88.0, 40.0, 94.0],
    "tests": [75.0, 90.0]
alice = {
    "name": "Alice",
    "homework": [100.0, 92.0, 98.0, 100.0],
    "quizzes": [82.0, 83.0, 91.0],
    "tests": [89.0, 97.0]
tyler = {
    "name": "Tyler",
    "homework": [0.0, 87.0, 75.0, 22.0],
    "quizzes": [0.0, 75.0, 78.0],
    "tests": [100.0, 100.0]
students =[lloyd,alice,tyler]
# Add your function below!
def average(numbers):
    return total/len(numbers)
def get_average(student):
    quizzes= average(student["quizzes"])
    tests= average(student["tests"])
    return 0.1*homework+0.3*quizzes+0.6*tests
def get_letter_grade(score):
    if score>= 90.0:
        return "A"
    elif score>= 80.0:
        return "B"
    elif score>= 70.0:
        return "C"
    elif score>= 60.0:
        return "D"
        return "F"
def get_class_average(students):
    for n in students:
    return average(results)


Is there any part of your code that says to display anything?


You aren't printing anything to the screen, but the assigment doesn't want you to print anything anyway


Ok, so what does the 'return' command do?


It just returns the value


But where does it return the value to? I don't understand what is happening when a value is returned if it is not displayed to the console.


When a something is returned it is given back.

Simply put, think of it as a pitcher and catch in baseball.

The pitcher will throw the ball on command every time.

Now as the coach if you failed to put a catcher in the right place the ball will not be caught.

So when you tell your pitcher to throw to you, ensure you have a catcher lined up.

Now lets put this into practice.

Python Code: With out a catcher!

def no_catcher():
    return True


As you can see nothing is displayed, but the function did throw the "ball."

Now lets put the catcher there.

Python Code: We found our catcher!

def pitcher():
    return "Ball"

def catcher(catch):

throw = pitcher()

I hope this analogy helps you a tad. As you learn more about programming you will find more interesting ways you can "throw" and "catch" your ball.

If you still have any questions feel free to ask.