Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def apply():
- colleges = {'UF':.15,
- 'Villanova':.3,
- 'BC':.08,
- 'Vanderbilt':.02,
- 'Richmond':.17,
- 'NC State':.65,
- 'Bing':.75,
- 'Stony Brook':.9,
- 'Fordham':.75,
- 'Auburn':.60,
- 'Clemson':.65,
- 'UTK':.55,
- 'Bucknell':.55,
- 'Fairfield':.35}
- rejectedFromAll = True
- for c in colleges:
- n = random.random()
- if n <= colleges[c]:
- rejectedFromAll = False
- return(rejectedFromAll)
- def main():
- result = False
- x = 0
- while (result == False):
- result = apply()
- x += 1
- print(x)
- print(f'It took {x} students until someone was rejected from all!')
- main()
Advertisement
Add Comment
Please, Sign In to add comment