How can I slow down a loop in Python? -


if have list l:

l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 

is there way control following for loop next element in list printed 1 second after previous?

for in l:     print 

in other words, there way elegantly slow down loop in python?

you can use time.sleep

import time  in l:     print     time.sleep(1) 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -