Student Becomes the Teacher 1. Lesson one


#1


Hi everyone. I don't know what's wrong with my code, but it keeps giving an error saying:

  File "python", line 3
    "homework": [],
              ^
SyntaxError: invalid syntax

................
I removed the: and next, it moved the ^ to:

 File "python", line 3
    "homework" [],
                ^
SyntaxError: invalid syntax

I know it's telling me that [] is the issue, but the directions told me to make an empty list*, so now, I can't proceed with the course. Here is my original code:

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

alice = {
    "name": "Alice"
    "homework": [],
    "quizzes": [],
    "tests": []
    }
    
tyler = {
    "name": "Tyler"
    "homework": [],
    "quizzes": [],
    "tests": []
    }

Also, Codecademy - not the console- is telling me:
Oops, try again. Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.
And as you can see, there is a dictionary named lloyd. :confused:

*Step three:
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!)


Help would be greatly appreciated. :slight_smile:


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


#2

here:

"name": "Lloyd" // missing ,

after each key value pair, there should be a ,. Even after strings


#3

Let me go back on the computer and see how it works. Thanks for a fast reply :smiley:
I didn't know commas came after strings in a dictionary that didn't have list []s


#4

Great it worked! :smile: It's been a little while since I've coded and I think I just needed a little refresher. Thank you so much! :smile:


#5