Sep-01-2020, 08:32 PM
As bowlofred says, you need a counter or flag.
not_printed_yet = True for i in range(100): if i % 2 == 0: # Will get here many times if not_printed_yet: # Only get here once print(i) not_printed_yet = False