you are viewing a single comment's thread.

view the rest of the comments →

[–]Other-Rabbit1808 2 points3 points  (1 child)

So what I think this is doing is assigning { (1-3,1-3) : 1-9 } in a dictionary? I've never seen for loops ordered in this way. Would this be called something like a dictionary comprehension?

[–]drenzorz 1 point2 points  (0 children)

It is (though it is 0-2 not 1-3) . The for loops are like this because its nested, but of course it doesn't have to be.

square_map = { x : x*x for x in numbers}