So, I'm just recently learning python and I was playing with some code. I wanted to print the some character without line breaks over a loop with some delay. I used the time.sleep() function inside the for loop. But, all it does is delay the output for the total time it would have taken in the loop, all at once and, then print out the character.
I did try it without the "end" attribute and it worked perfectly. But, I didn't want the line break.
from time import sleep
print("starting the progress bar")
for i in range(50):
sleep(0.1)
print("#", end = '')
I expected the output to print a character and with a delay, print another character. But, the script delays for 0.1 seconds for 50 times and then prints out all the characters at once