Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def chooser():
- number = random.randrange(3)
- if number == 0:
- options['special meal at home'] += 1
- if number == 1:
- options['BBQ with GOLPE'] += 1
- if number == 2:
- options['romantic kebab dinner'] += 1
- options = {'special meal at home': 0, 'BBQ with GOLPE': 0, 'romantic kebab dinner': 0}
- upper = 1e5
- for i in range(int(upper)):
- chooser()
- winner = max(options, key=options.get)
- # for keys, value in options.items():
- # print('{0} = {1}'.format(keys, value))
- print('Winner: {0} with {1} votes'.format(winner, options[winner]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement