1. lesson number one


#1

i keep getting an error and i cant find how to fix it
"""my code"""
lloyd = {
"name",
"homework",
"quizzes",
"tests"
}
alice = {
"name",
"homework",
"quizzes",
"tests"
}
tyler = {
"name",
"homework",
"quizzes",
"tests"
}

lloyd["name"]="Lloyd"
alice["name"]="Alice"
tyler["name"]="Tyler"
"""error message"""

Traceback (most recent call last):
File "python", line 20, in
TypeError: 'set' object does not support item assignment
can anyone give me some assistance


#2

Hi you should put your name student inside your object liKe that

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

Do the same for the others student.


#4

i did that and now im getting the error
File "python", line 3
"homework",
---------------^
SyntaxError: invalid syntax
(its poining at the comma)


#5

After that you should set the others propriety to a empty array [] like that

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

For all your students.


#6

thanks it worked, i appreciate the help


#7

My code is generating this error. I don't understand what the issue is. Please help me.

Thank you


#8

Your dictionary name for Lloyd is spelled incorrectly.


#9

Hi like @totallynectar say you wrote llyod instead of lloyd


#10

Thank you. That was silly of me. :smile:


#11

This solved problem... thank you ...


#12

Friends, This way it works

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


#14

I figured this one out, after looking at the examples shown in the Q&A, but am having a lot of trouble understanding why the name : key is required to NOT have brackets. I would think that consistency throughout the dictionary would be important/ even preferable. Here are my screenshots of the incorrect and correct answer. Can anyone explain why the set of [] around Lloyd are not used in this setting?


#15

I have the same question. Any ideas?


#16

Hi I think that its because ifyou put the name of your students inside the [] your student name will become list instead of string but they want you to set it equale to a string of the name of your students.
Hope I could help you understand it.


#17

I have the same code, but mine still doesn't work. Still says name key does not have the value "Lloyd" in your Lloyd dictionary. I don't get it...


#22