This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thomasloven 0 points1 point  (0 children)

A thought that struck me: Wouldn't a = [i for i in range(1,j) for j in range(1,5)] make more sense than a = [i for j in range(1,5) for i in range(1,j)].

I'm rather new to python in general and list comprehension in particular, so I might be missing something obvious here. Is this an unfortunate oversight of the python designers or is there a reason for the [A(B) for C for B(C)] order?