# Just Weight and See Don't understand

#1

I have this code:

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

def average(numbers):
total=sum(numbers)
total=float(total)
total=total/len(numbers)

def get_average(student):
homework=average(student["homework"])
quizzes=average(student["quizzes"])
tests=average(student['tests'])
homework=homework*10
quizzes=quizzes*30
tests=tests*60
work=homework+quizzes+tests
return work``````

The instructions say:

I don't no what the weights are(I am not great with math). Can some one tell me?
This exercise is here:
Thank you.

#2

@printcoder_eric,
You will have to change your code

``````homework=homework*10
quizzes=quizzes*30
tests=tests*60``````

into

``````homework=homework*10/100
quizzes=quizzes*30/100
tests=tests*60/100``````

as 10% is 10/100

#3

@leonhard.wettengmx.n
Ah! I see, but just asking, do decimals( floating point ) work too?

#4

@printcoder_eric,
javascript floating point site:stackoverflow.com
http://stackoverflow.com/questions/1458633/how-to-deal-with-floating-point-number-precision-in-javascript
python floating point site:stackoverflow.com
http://stackoverflow.com/questions/455612/limiting-floats-to-two-decimal-points

== the Book ==