Skip to content

Instantly share code, notes, and snippets.

View guru-beach's full-sized avatar

Jake Lundberg guru-beach

View GitHub Profile
@guru-beach
guru-beach / choose_winner.py
Created December 27, 2016 20:06
How I went about picking a winner for a contest
import random
contestants = ['mitch', 'dave', 'michael', 'james b', 'james g', 'robyn', 'cole', 'richard', 'tom', 'lonnie']
def choose_winner(contestants, cycles):
max_count = 0
max_person = 'jake'
random.seed()
counts = dict(zip(contestants,[0]*len(contestants)))
for i in range(cycles):
1 Patrick Hoag - Descendents: 132
2 Eric Compton - Descendents: 2
3 Delane Croissant - Descendents: 0
3 Cory Croissant - Descendents: 0
2 Jeremy Dicks - Descendents: 2
3 David Jones - Descendents: 1
4 Anthony Gentile - Descendents: 0
2 Terry Baldwin - Descendents: 0
2 Brandon Parker - Descendents: 30
3 Terry Knowlton - Descendents: 6