Student becomes teacher


#1

I JUST CAN'T UNDER STAND WHERE IS THE PROBLEM IN MY CODE
lloyd={
"name": ["Lloyd"],
"homework":[],
"quizzes":[],
"tests":[],
}
alice={
"name":[],
"homework":[],
"quizzes":[],
"tests":[],
}
tyler={
"name":[],
"homework":[],
"quizzes":[],
"tests":[],
}


#2

Hi this part as name value you put ["Lloyd"]

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

just remove the [ ] around "Lloyd" and do the same for alice and tyler


#3

hi it worked hen i edited the code like this but i still can't understand the reson
lloyd = {
"name": "Lloyd",
"homework":[],
"quizzes":[],
"tests":[],
}
alice = {
"name":"Alice",
"homework":[],
"quizzes":[],
"tests":[],
}
tyler = {
"name":"Tyler",
"homework":[],
"quizzes":[],
"tests":[],
}


#4

They aske you put "homework", "quizzes", "teste" equal to a empty list and you did ...and they says to put the "name" equal to "Llloyd" name and it work but if you put "Lloyd" inside [ ] it will be "name" equal to a list which has one element "Lloyd" so that why it only work if you put ti without [](because it should be equale to the string of the name of lloyd)


#5

thank you so much i understood it very well :slight_smile:


#6

I did the same thing but realized something as little as not capitalizing the names in name key makes it not work.


#7

it's alright we all face things like that :wink:


#8

Thanks for this explanation, I had the exact same problem and thought I was going crazy!


#9

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