2
PYTHON 3
import time
for i in range (1, 11):
time.sleep(1)
print (i)
RESULT: Screen output every second.
Based on the above instructions, every time the condition is true a result will be printed on the screen every second. So far so good.
But when I use end="", the loop only prints my result when the condition is no longer true, that is, it does not print every second and yes, only when it ends.
import time
for i in range (1, 11):
time.sleep(1)
print (i, end=" ")
RESULT: Screen output only at the end of the loop.
MORAL OF THE QUESTION: How could I print a result EVERY SECOND without line break?
I’m new in the business, also did not know about the FLUSH, therefore justifies the duplicate rsrs. Thanks to those who directed me to the link because solved my question :)
– Fernando Barros