Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created July 21, 2020 02:53
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 IndhumathyChelliah/0790b318ce4a5926a1c77c26c11d2386 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/0790b318ce4a5926a1c77c26c11d2386 to your computer and use it in GitHub Desktop.
a1=['red','green','blue']
b1=[0,1,2]
a2=[(a,b) for a in a1 for b in b1]
print (a2)#Output:[('red', 0), ('red', 1), ('red', 2), ('green', 0), ('green', 1), ('green', 2), ('blue', 0), ('blue', 1), ('blue', 2)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment