Skip to content

Instantly share code, notes, and snippets.

@alperozaydin
Last active September 4, 2018 09:41
Show Gist options
  • Save alperozaydin/88052be5a0c4a96f80bfae73cd563894 to your computer and use it in GitHub Desktop.
Save alperozaydin/88052be5a0c4a96f80bfae73cd563894 to your computer and use it in GitHub Desktop.
match
import random
rng = 1000000.0
people = [0, 0, 0, 0, 0]
for k in range(0, int(rng)):
match = [True, True, True, True, False]
random.shuffle(match)
min = 0
max = 4
for i in range(0, 5):
x = random.randint(min,max)
if match[x] == False:
people[i] = people[i] + 1
break
match.pop(x)
max = max - 1
for item in people:
print str(float((item)/rng)*100) + "%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment