Help needed!


#1



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


This was beneath the code:

Oops, try again. Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.

And this was the result:

File "python", line 2
"name" = ["Lloyd"],
^
SyntaxError: invalid syntax


I expected it to let me pass! But something was wrong. Can someone hint me in the right direction? Thanks!


Replace this line with your code. 
lloyd = {
    "name" = ["Lloyd"],
    "homework" = [],
    "quizzes" = [],
    "tests" = [],
}
alice = {
    "name" = ["Alice"],
    "homework" = [],
    "quizzes" = [],
    "tests" = [],
}
tyler = {
    "name" = ["Tyler"],
    "homework" = [],
    "quizzes" = [],
    "tests" = [],
}
SyntaxError: invalid syntax


#2

You haven't shown us your code, but from the error message, it looks like you haven't done that.

A dictionary named lloyd is going to start off something like:

lloyd = {  }

#3

Okay, so i showed the code. Sorry.


#4
  1. To assign values to keys, we use :, not =.
  2. "Lloyd" shouldn't be a list, it is just one name, not a list of items. Make it be just a string.

#5

in dictionary key - value line use : instead =


#6

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