Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- # Inicializa el módulo random():
- random.seed()
- # Genera un número aleatorio:
- print(random.random())
- # Selección aleatoria de un elemento de una lista:
- primos = [2, 3, 5, 7, 11]
- print(random.choice(primos))
- # Entero aleatorio entre 1 y 100:
- print(random.randint(1, 100))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement