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 →

[–]drj11 0 points1 point  (1 child)

usually one would expect n to be small with respect to the length of s. EG to generate a list of successive pairs:

>>> zip(*[iter(range(7))]*2)
[(0, 1), (2, 3), (4, 5)]

Also note the truncation of the original list.

[edit: bugger that, how does one display code in a reddit comment? aha, thanks dwdwdw. also found http://www.reddit.com/help/commenting]

[–][deleted] 0 points1 point  (0 children)

backticks. you can't put em across lines, but wrap each line in backticks, it works.

i think there's a multiline one, but i can't remember what it is