Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # random_module.py
- import random
- for z in range(10): print random.random()
- for z in range(10): print random.uniform(1,10)
- for z in range(10): print random.choice(['cat','dog','fish','bird','monkey','horse','rabbit','snake','hamster','turtle','deer','cameleon','lizard'])
- for z in range(10): print random.randint(1,10)
- arr = [1,2,3,4,5,6,7,8,9]
- for z in range(10):
- random.shuffle(arr)
- print arr
- for z in range(10): print random.sample(arr,4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement