Python Unit 6 Exercise 1. Lesson Number One


#1

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


After creating the dictionaries and its keys, the instruction is telling to

Have the "name" key be the name of the student (that is, lloyd's name should be "Lloyd") and the other keys should be an empty list. (We'll fill in these lists soon!)

But here is what I got

Any idea what I did wrong? Thanks.


#2

Hi @cakthe ,

Yes, it says ...

... lloyd's name should be "Lloyd" ...

... but you have "name": ["Lloyd"]

There is a difference.


#3

So should it be "name": "Lloyd" ?


#4

Give it a try. Let us know what happens.


#5

Nice! It works!

But why the name key won't accept the "[]" parentheses? Is it because of the unallowed syntax or simply because of the concept that "nobody has multiple names"?


#6

The syntax is allowable. It is rather, as you suggest, because everyone in this class has only one name. The message you saw was the result of Codecademy's submission correctness test (SCT), which is designed to check your code. The criteria include the requirement that the code conform to the instructions given in the exercise.

Since each student will have only one name, the decision was made that the value associated with the "name" key will not be put into a list. The other keys will refer to lists, because there will be more than one "homework", "quizzes", and "tests" grade for each student.


#7

I get it. Thanks a lot!


#8

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