a = [1,2,3] for i in a: print (i)
here is a simple code I would like to delay the print result while the for loop goes through the list. meaning I want a delay between the value 1 and 2 in the list item
a = [1,2,3] for i in a: print (i)
here is a simple code I would like to delay the print result while the for loop goes through the list. meaning I want a delay between the value 1 and 2 in the list item
Use the sleep
function inside the time
module:
from time import sleep
a = [1, 2, 3]
for i in a:
print(i)
sleep(0.5). # Sleeps for 0.5 seconds