I want to display a series numbers in the same line using a for loop, this is what I did:
for i in range(10):
sleep(1)
print(i, end=" ")
This is supposed to print the numbers (0, 1, 2, ..., 10) one after another with each iteration of the for loop, instead the program waits until the loop has finished and then prints all the numbers at once.
I don't understand why this is happening, does any one have any idea what causes this behavior and thanks?