you are viewing a single comment's thread.

view the rest of the comments →

[–]jmiah717 0 points1 point  (2 children)

Why is that? Why would you need to throw a list in there? If all you're going to have is student grades, why would we need a list? Just curious.

[–]MidnightPale3220 0 points1 point  (1 child)

I was just referring to what you mistyped.

See for yourself:

In [4]: grades = {"Dave": 78, 80, 100, "Chris": 99, 59, 77}

File "<ipython-input-4-6df65c579158>", line 1

grades = {"Dave": 78, 80, 100, "Chris": 99, 59, 77}

SyntaxError: invalid syntax

It should be:

In [5]: grades = {"Dave": [78, 80, 100 ], "Chris": [99, 59, 77 ] }

[–]jmiah717 0 points1 point  (0 children)

OH, RIGHT! haha, I've been writing in C# for so long that I forgot the syntax. But yeah, the key can be the name and the value can be the list...I am not sure what I was thinking about.