We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
a = [[raw_input(), float(raw_input())] for i in xrange(int(raw_input()))]
shows something about the order in which comprehensions are executed. "B" (in comment above) happens first, so xrange gets N. I suppose if there was a raw_input() call in C (the optional "if" statement), that woud happen next (left to right?). Finally the A bit is executed left to right.
I'm just making assumptions here. Please correct me if its wrong.
Nested Lists
You are viewing a single comment's thread. Return to all comments →
The answer in the Editorial tab
a = [[raw_input(), float(raw_input())] for i in xrange(int(raw_input()))]
shows something about the order in which comprehensions are executed. "B" (in comment above) happens first, so xrange gets N. I suppose if there was a raw_input() call in C (the optional "if" statement), that woud happen next (left to right?). Finally the A bit is executed left to right.
I'm just making assumptions here. Please correct me if its wrong.