Lesson Number One


#1

llyod = {
"name": ["Llyod"],"homework": [],"quizzes": [],"tests": []
}
alice = {
"name": "Alice","homework": [],"quizzes": [],"tests": []
}
tyler = {
"name": "Tyler","homework": [],"quizzes": [],"tests": []
}
This is throwing an error:Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.


#2

Remove the Brackets from around "Lloyd"


#3

It Now throws an error : Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.
Now the code is :
llyod = {
"name": "Llyod","homework": [],"quizzes": [],"tests": []
}
alice = {
"name": "Alice","homework": [],"quizzes": [],"tests": []
}
tyler = {
"name": "Tyler","homework": [],"quizzes": [],"tests": []
}


#4

here:

llyod = {

you misspelled lloyd


#5

Hahaha...
Thanks
You just a saviour... :stuck_out_tongue:
Silly Me


#6

I am really confused by this because in the example given there are brackets around the values in the lists. Are there only brackets when there are more than one?

animal_sounds = {
"cat": ["meow", "purr"],
"dog": ["woof", "bark"],
"fox": [],
}


#7

square brackets makes it list, a list can have multiply values

for the exercise, the names must be strings, not lists


#8

A post was split to a new topic: Lesson number one


#9

A post was merged into an existing topic: Lesson number one


#10

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