1. Lesson Number One


#1

I am getting this error "Oops, try again. Did you give alice the name key?" for the following code.

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

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

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

Can anyone help me on this


1. Lesson Number One
#2

HI the name of your dictionaries should be lloyd, alice, tyler

lloyd {
....
}
....

#3

Change Lloyd to lloyd on the very first line
then change Alice to alice in the Dictionary name
and finally change Tyler to tyler
PS the first letter should not be capital in the Dictionary name

The code follows below :

lloyd = {
"name": "Lloyd",
"homework": [],
"quizzes": [],
"tests": []
}
alice = {
"name": "Alice",
"homework": [],
"quizzes": [],,
"tests": []
}
tyler = {
"name": "Tyler",
"homework": [],
"quizzes": [],
"tests": []
}
Hope this helps


#4

I got the same issue. Could someone help us?
Thank you so much.


#5

hey pal, why are the square brackets [] not needed around key Lloyd? is it because there is only one key?


#6

you forgot the comma ',' after the "tests":[] so you need to change it by

"tests" : [],

and you added a comma "," to "quizzes" : [],, in the dictionary Alice, you should erase it.

Good luck


#7

my code:

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

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

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


#8

guys help. it's saying i haven't given the name key a value
lloyd = {
"name": ["Lloyd"],
"homework": [],
"quizzes": [],
"tests": [],
}
print lloyd["name"]
alice = {
"name": ["Alice"],
"homework": [],
"quizzes": [],
"tests": [],
}
print alice["name"]
tyler = {
"name": ["Tyler"],
"homework": [],
"quizzes": [],
"tests": [],
}
print tyler["name"]


#9

never mind guys i figured it out


#10

Hi,

How did u figure it out ?


#11

Hello all. I'm getting a different error than everyone else. I'm getting "Oops, try again.
Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.
"

Here's my code.

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

allice = {
    "name": ["Alice"],
    "homework": [],
    "quizzes": [],
    "tests":[],
}
print alice["name"]

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

Any help would be greatly appreciated! :grin:


#13

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

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

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

there is the completed section


#14

hope that helped!!!!! :slight_smile: :slight_smile: :slight_smile: :slight_smile:


#15

Thank you, apparently that did help! I swear my code looked exactly the same, but when I copied and pasted your code in there it worked.... oh well, at least I'm done with it lol. I'll never knoooooww.... :joy::grin:

Thanks for the help!


#16

try posting your code down below, I can help you figure out what the problem


#17

A comma is unnecessary after the last key & value in the dictionary.
This is my working code.

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

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

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

#18

shikhar31 you have a double comma at alice's quizzes, thats why it didn't work for me, so here my code:

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

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

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

hope this helps someone


#19

Thank you Tomosuto,
I didn't know that. ^_^


#20

I'm having the same kind of problem. I can't see any problem, but it keeps saying that the global name lloyd isn't defined.
lloyd = {
"name": "Lloyd",
"homework": [],
"quizzes": [],
"tests": []
}
alice = {
"name": "Alice",
"homework": [],
"quizzes": [],
"tests": []
}
tyler = {
"name": "Tyler",
"homework": [],
"quizzes": [],
"tests": []
}
Any help would be greatly appreciated


#21

i too want an answer to this question