Lesson Number One


#1



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


Oops, try again. Did you create a dictionary named lloyd? Your code threw a "global name 'lloyd' is not defined" error.


It looks fine to me but I think there is probably a small error I can't detect


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

I did create a dictionary called Lloyd!


#3

can you post your code with markup:

make sure the backticks are above and below the code, not on the same line


#4

the lloyd dictionary should be all lowercase letters?


#5

That was an accident in this post sorry so it didn't fix my original code


#6

{{"name"

there are two curly brackets, why?


#7

Also another error only in this post :frowning:


#8

How can you make errors in this post? You simply copy paste the code from the lesson. If you don't, i won't be able to find the mistake


#9

My apologies. Here is a full on copy paste. (which i what i thought i had in the first place)

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

I used tab make big spaces in between to make it look like it does in the description


#10

ugh it didnt print out right but im positive the code at the top is the same as mine now except for the spaces


#11

why would you use so much tabs? It doesn't make much sense, it ruins the readability of your code.

you could simply use enters:

lloyd = {
   "name": "Lloyd"
}

that would make more sense.


#12

when i use enters it creates a new line, how do you prevent that?


#13

Doesnt the creation of the new line ruin the code?


#14

that is kind of the point of enters?

not when used correctly, a dictionary can be created over multiply lines


#15

Oh for some reason i thought otherwise. Anyways if it would help you, in the interpreter it says "Indentation error:unexpected indent"


#16

can i see your code again?


#17

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

#18

 alice = {

alice (and tyler) seem to have one space as indent, why?


#19

I don't exactly know what you mean :confused: could you post one of the dictionaries in the way you would do it so I can understand better? sorry for the trouble.


#20

At this point in the course, i have to assume you know what indent(ion) is, python uses it to determine what inside function, loop and so on. How can you make it this far, and not know this?

one space also counts as indent, remove the space which is in front of alice = {


#21

more properly a clear indent is 4 spaces, if I don't do tab or 4 spaces it has an error about "invalid syntax: expected an indention"