Advertisement
here2share

# random_module.py

Jul 21st, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. # random_module.py
  2.  
  3. import random
  4.  
  5. for z in range(10): print random.random()
  6.  
  7. for z in range(10): print random.uniform(1,10)
  8.  
  9. for z in range(10): print random.choice(['cat','dog','fish','bird','monkey','horse','rabbit','snake','hamster','turtle','deer','cameleon','lizard'])
  10.  
  11. for z in range(10): print random.randint(1,10)
  12.  
  13. arr = [1,2,3,4,5,6,7,8,9]
  14.  
  15. for z in range(10):
  16.     random.shuffle(arr)
  17.     print arr
  18.  
  19. for z in range(10): print random.sample(arr,4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement