Category "list-comprehension"

List comprehension: Returning two (or more) items for each item

Is it possible to return 2 (or more) items for each item in a list comprehension? What I want (example): [f(x), g(x) for x in range(n)] should return [f(0),

Python: Printing a list with a line break after every nth item

I have a list of media that I want to print in the following format, with a line break after every nth item: media_list = ['A001', 'A002', 'A003', 'A004', 'A00

Line continuation for list comprehensions or generator expressions in python

How are you supposed to break up a very long list comprehension? [something_that_is_pretty_long for something_that_is_pretty_long in somethings_that_are_pretty