I am trying to write a time algorithm. However, I am having a problem successfully printing the code on the same line by overwriting the previous print
I have tried to use "\r" to print it on the same line. However, it does not work as after finishing the first minute, the seconds go like 09,19,29,39 and so on.. not sure what the problem is here.
However, if I remove the "\r", the program works fine except it prints the time in a new line every time. I want to print it in the same line.
import time
for i in range(24):
for a in range(60):
for s in range(60):
print(i,":",a,":",s, end='\r')
time.sleep(1)
I expect the output to be a just like normal time. However it isn't working the same way not sure why