loop a range() Function with a time delay- Python
Question: How to loop a range() Function x number of times with a time delay in Python?
for example, for i in range(4,9) repeat it for 3 times and each time stop 5
second before starting the new count. The answer should be like this:

    
    
    "0 second delay"  (4,5,6,7,8,9)
    "5 second delay"  (4,5,6,7,8,9)
    "10 second delay"  (4,5,6,7,8,9)
    


Answer: How about this?

    
    
    from time import sleep
    N = 3  # number of times you want to repeat
    for d in xrange(N):
        sleep(d * 5)  
        for x in xrange(4, 10):
            # do something
    

**Note** : Assuming Python 2.x (xrange) otherwise, you should use the regular
range (Python 3.x).

