for i in range(5): if i == 3: break print(i) code example Example: for i in range(0): print(i) for i in range(0): print(i)