Need help with "what's the score" 2/9


#1



https://www.codecademy.com/en/courses/python-beginner-en-qzsCL/0/2?curriculum_id=4f89dab3d788890003000096


I am just learning to code and I am having trouble with this problem. Although I am not receiving any error message and the program is allowing me to move on to the next section (3/9), I am sure that my solution for 2/9 is wrong because the key values for lloyd don't carry through to the next exercise...the lists remain empty! I don't know how to upload those values into the empty lists in the lloyd dictionary. Here's the code. Thanks in advance for the help!

lloyd = {
    "name": "Lloyd",
    "homework": [],
    "quizzes": [],
    "tests": []
}

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

print lloyd

lloyd["homework"]=[90.0, 97.0, 75.0, 92.0]
lloyd["quizzes"]=[88.0, 40.0, 94.0]
lloyd["tests"]=[75.0, 90.0]

print lloyd

i would think if the code was correct, it would fill in the empty brackets in section 3/9, but it isn't


Replace this line with your code.


#2

In 2. What's the score?, you don't have to write the code to input the values for the 'lloyd' dictionnary; you don't have to do:

print lloyd

lloyd["homework"]=[90.0, 97.0, 75.0, 92.0]
lloyd["quizzes"]=[88.0, 40.0, 94.0]
lloyd["tests"]=[75.0, 90.0]

Instead, you have to input the values directly in the script.
So, instead of:

lloyd = {
    "name": "Lloyd",
    "homework": [],
    "quizzes": [],
    "tests": []
}

alice = {
...
tyler = {
    "name": "Tyler",
    "homework": [0.0, 87.0, 75.0, 22.0],
    "quizzes": [0.0, 75.0, 78.0],
    "tests": [100.0, 100.0]
}

print lloyd

lloyd["homework"]=[90.0, 97.0, 75.0, 92.0]
lloyd["quizzes"]=[88.0, 40.0, 94.0]
lloyd["tests"]=[75.0, 90.0]

You have to modify the script so that it looks like this:

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 = {
...

tyler = {
    "name": "Tyler",
    "homework": [0.0, 87.0, 75.0, 22.0],
    "quizzes": [0.0, 75.0, 78.0],
    "tests": [100.0, 100.0]
}

#3

Hi.. Thank you for your help. I actually had tried to cut and paste the values each of the lists in 2.9. I click on "save and submit" and it allows me to move to 3.9, but the values I cut and pasted are not filled in. So I cut and paste the whole section again...and again, it allows me to submit and save but in section 4.9, the lists are still empty. Does it expect me to keep cutting and pasting this section of code every time? It doesn't seem right...am I missing something else? Thanks!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.