Skip to content

Instantly share code, notes, and snippets.

@artlung
Created May 19, 2010 00:30
Show Gist options
  • Save artlung/405765 to your computer and use it in GitHub Desktop.
Save artlung/405765 to your computer and use it in GitHub Desktop.
Lottery Python Program
"""A simple lottery to demonstrate module and script interaction in Python."""
import random
PEOPLE = ('Dale', 'Will')
def winner(people=PEOPLE):
"""Choose a winner at random from the given list of people."""
x = random.randrange(0,len(people))
return people[x]
# The if statement below is only true if we are calling this file as a script.
if __name__ == '__main__':
print '... and the winner is!'
your_input = raw_input()
print winner(PEOPLE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment