Student Becomes Teacher: Lesson One


#1

Can't figure out anything on my own as usual. I wish this thing would give more useful error messages. Presently stuck on:

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

File "python", line 6
}
^
SyntaxError: invalid syntax

Why is it saying the end curly bracket is invalid syntax? I've tried every indentation position but it doesn't seem to care.


How Is everybody doing?
#2

You need commas after each quoted part


#3

I had it that way at first and it was saying each comma was invalid syntax till I took them away, then went to the curly bracket being invalid

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

File "python", line 3
"homework",
^
SyntaxError: invalid syntax


#4

The basice set up is a string for name, which you have, and an empty list, [] after a colon for each of the other three properties.

'name': 'Lloyd',
___: [],
___: [],
___: [],

#5

I also had tried that thinking that's what it wanted, and it points to the empty brackets saying they are invalid syntax. Sorry I haven't been able to figure out how to post to where it looks like code. Oh wait... needed colons and brackets! Ok at least this first part is working finally.


#6

It would help if we know the lesson. There are a couple of steps taken to build the dictionaries taking two of three lessons to complete. Please post a link to the exercise you are on. Thanks.


#7

It was referencing the exercise in the thread that I posted it in, just the beginning section. Now that it is moved it has no context.


#8

There is enough context and the post does not relate to the other question, which is resolved.


#9

alright I changed the title so it might help someone else with this ex


#10

How about posting a link while you still can? Thanks.


#11

Sorry, a link to what?


#12

The exercise, so we don't have to search and guess.


#13

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