I would like to inquire if there is an elegant pythonic way of executing some function on the first loop iteration. The only possibility I can think of is:
f
Here is what works for me
dup_count = 0 for x in reversed(dup_list): dup_count += 1 if dup_count == 1: print("First obj {}: {}".format(dup_count,x)) else: print("Object # {}: {}".format( dup_count,x ))