-
-
Save IndhumathyChelliah/eb0a7a2785da4fe7ddcc1ce434c970e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_list=[['red','orange'],['apple','banana','orange'],['carrot']] | |
result=[(i1,i2) for (i1,v1) in enumerate(my_list) for (i2,v2) in enumerate(v1) if v2=='orange'] | |
print(result) | |
#Output: | |
[(0, 1), (1, 2)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment