I wonder whether there\'s a quicker and less time consuming way to iterate over a list of tuples, finding the right match. What I do is:
# this is a very lon
The question is dead but still knowing one more way doesn't hurt:
my_list = [ (old1, new1), (old2, new2), (old3, new3), ... (oldN, newN)] for first,*args in my_list: if first == Value: PAIR_FOUND = True MATCHING_VALUE = args break