tuple_find_firstsearches forward throughTuplefor the first occurrence of the values of the second tupleToFindand returns theIndex(in relation to the first input tupleTuple). For example, ifTuplecontains the values [3,4,5,6,1,2,3,4,0] andToFindcontains the values [3,4], the outputIndex...
def find_first_element(tuples, second_value): for first, second in tuples: if second == second_value: return first return None # Return None if the second value is not found # create the tuple list my_tuples = [("amar", 3), ("akbar", 2), ("anthony", 31)] second_value = ...