Skip to content

Instantly share code, notes, and snippets.

@LeoHuckvale
LeoHuckvale / python-unzip
Last active August 29, 2015 14:05
"un"-zipping in Python
def breakfast(i):
"""Some function that returns a tuple"""
spam = i
eggs = i
return spam, eggs
# A list comprehension that generates results
results = [breakfast(i) for i in range(1, 4)]
## or, if you like that sort of thing:
# results = map(breakfast, range(1, 4))