Inquiry About 1. Lesson Number One


#1



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

I already completed the exercise, but I had to look at another answer to see what I did wrong.

Why is this wrong:

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

but this correct?

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


#2

@anikafernandes,
Please read
https://en.wikipedia.org/wiki/Object-oriented_programming

======================================================

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

You have defined a variable lloyd
to which you assign a literal-notated object / dictionary
which contains
4 key-value pairs, which are so-called properties
in this case you have
a "name" property with a "name" property-key with an associated string Value "Lloyd"
a "homework" property with a "homework" property-key with an associated empty list Value []
a "quizzes" property with a "quizzes" property-key with an associated empty list Value [ ]
a "tests" property with a "tests" property-key with an associated empty list Value [ ]

You should also notice the usage of a comma-, as a property-separator
and the last used comma-, after your "tests" property is NOT needed......


#3

Thank you for your polite answer. You have been an instrumental help.


#4