Created
May 19, 2010 00:30
-
-
Save artlung/405765 to your computer and use it in GitHub Desktop.
Lottery Python Program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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