How to first matching index of a tuple in list of tuples in Python

1 Answer

0 votes
tuples = [(1, "c++"), (2, "python"), (3, "python"), (4, "java")]

print(tuples.index((2, 'python')))


'''
run:

1

'''

 



answered Nov 27, 2018 by avibootz
...