Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created Jul 21, 2020
Embed
What would you like to do?
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