Just Weight and see


#1

Im working just weight and see, I thing there is an error in codecadamy. Below is my code. I am getting the error that a string and integer cant go after one another when codecademy runs alice through average. Here is the exact error message; get_average(alice) raised the following error: unsupported operand type(s) for +: 'int' and 'str'.

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]
}

Add your function below!

def average(x):
total = sum(x)
average = float(total)/len(x)
return average

`


#2

@megajumper35481,
Try calling the average function using
alice['homework'] as an ARGUMENT


#3

name your function "get_average" thats all