Posted By

Desoxena on 12/18/10


Tagged


Versions (?)

Python Random Timer


 / Published in: Python
 

this will grab a random integer between 1 and 1000, and count up to that random number, thus, a random timer.

  1. import random
  2. var = random.randrange (1, 1000)
  3. for i in range(1, var):
  4. print i, // note that this was made on a IDLE that counts one
  5. by one.
  6. ---------------------------------------------- below is one that would work in
  7. most if not all IDLEs
  8. import time
  9. import random
  10. var = random.randrange(10)
  11. time.sleep(var)

Report this snippet  

You need to login to post a comment.