Question: why does in Python code time.sleep(3) not print items from list every 3 secs...? here is my simple code that i am running in http://py3.codeskulptor.org
why does in Python code time.sleep(3) not print items from list every 3 secs...? here is my simple code that i am running in http://py3.codeskulptor.org
for some reason the sleep(3) holds everything and then prints it at one time....!!!??... but according to code description, suppose to print a line every 3 secs
import time
mylist = ['aaa','bbb','ccc']
for i in mylist:
time.sleep(3)
print(i)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
