Advertisement
Fhernd

seleccion-elementos-aleatorios.py

Jun 4th, 2018
1,628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import random as rnd
  2.  
  3. numeros = [2, 3, 5, 7, 11]
  4.  
  5. print(rnd.choice(numeros))
  6. print(rnd.choice(numeros))
  7. print(rnd.choice(numeros))
  8. print(rnd.choice(numeros))
  9. print(rnd.choice(numeros))
  10.  
  11. print('')
  12.  
  13. rnd.shuffle(numeros)
  14. print(numeros)
  15.  
  16. print('')
  17.  
  18. print(rnd.sample(numeros, 3))
  19. print(rnd.sample(numeros, 3))
  20. print(rnd.sample(numeros, 2))
  21. print(rnd.sample(numeros, 2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement