Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- SIMULACIONES = 10000000
- baraja_inicial = [0 for _ in range(13 * 4)]
- baraja_inicial.extend([1, 1])
- baraja = list(baraja_inicial)
- jokers = 0
- for _ in range(0, SIMULACIONES):
- carta = random.randrange(len(baraja))
- if baraja[carta] == 1:
- jokers += 1
- baraja = list(baraja_inicial)
- else:
- del baraja[carta]
- print("Simulaciones %d, jokers %d, porcentaje %.5f" % (SIMULACIONES, jokers,
- float(jokers) /
- float(SIMULACIONES)))
Advertisement
Add Comment
Please, Sign In to add comment