a = 0 switch = True for i in range(2000): print(round(a,1)) if switch: a += 0.1 switch = False else: a+=1 switch = True