proffreda

Birthday Paradox: Python Simulation

Mar 6th, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. import random
  2. birthdays=[]
  3. done = False
  4. while (not done):
  5. next = random.randint(1,365)
  6. #print(next)
  7. if next in birthdays:
  8. done = True
  9. else:
  10. birthdays.append(next)
  11. print("End of Simulation")
Advertisement
Add Comment
Please, Sign In to add comment