def flatten(nested): for sublist in nested: for element in sublist: yield elementnested = [[1, 2], [3, 4], [5]]for num in flatten(nested): print numprint list(flatten(nested))
Name (required)
email (will not be published) (required)
Website