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

# Add your function below!
def average(numbers):
    total=sum(numbers)
    total=float(total)
    total=total/len(numbers)
    return total

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:
https://www.codecademy.com/courses/python-beginner-en-qzsCL/1/2?curriculum_id=4f89dab3d788890003000096
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,
google search
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

google search
== the Book ==
jquery [your question] site:developer.mozilla.org
CSS [your question] site:developer.mozilla.org
javascript [your question] site:developer.mozilla.org
[your question] site:jquery.com
[your question] site:getbootstrap.com

== discussions / opinions ==
jquery [your question] site:stackoverflow.com
CSS [your question] site:stackoverflow.com
javascript [your question] site:stackoverflow.com

== guidance ==
www.crockford.com
[your question] site:crockford.com
- - http://javascript.crockford.com/code.html
- - http://javascript.crockford.com/survey.html

http://stackoverflow.com/questions/1795438/load-and-execution-sequence-of-a-web-page
http://www.w3schools.com/jquery/trysel.asp