How can I slow down a loop in Python?
Question: If I have a list l:

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

Is there a way to control the following _for_ loop so that the next element in
the list is only printed one second after the previous?

    
    
    for i in l:
        print i
    

In other words, is there a way to elegantly slow down a loop in Python?


Answer: You can use `time.sleep`

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

