Skip to content

Instantly share code, notes, and snippets.

@peterskim12
Created March 27, 2014 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterskim12/9815338 to your computer and use it in GitHub Desktop.
Save peterskim12/9815338 to your computer and use it in GitHub Desktop.
nested for loops in python list comprehension
senders = ['paul', 'frank']
recipients = ['joe', 'al', 'peter', 'chris']
print [(sender, recipient) for sender in senders for recipient in recipients]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment