How to find the position (index) of tuple inside a tuple with Python

1 Answer

0 votes
tpl_tpl = ('a', ('b', 'c'), ('a', 'b'), ('x', 'y'), [5, 6, 7])

index = tpl_tpl.index(('x', 'y'))

print(index)



'''
run:

3

'''

 



answered Dec 25, 2019 by avibootz
...