Python-Slots

This is a python-based slot machine.


# pythonSlots.py
# (c)2009 Wolf Halton
# wolf-@-wolfhalton.info (remove the dashes)
#
# This code is licensed under the GPL2
# You may use and modify, without warranty of usefulness
#
import random

def main():
print "++++++++++++++++++++++++++\n\n"
print "Here's a slot machine"
coin = input('how many coins would you like to enter? ')
for i in range (1, (coin + 1)):
slots()
print "\n\nThanks For Playing\n\n"

def slots():
choice = raw_input('Would you like to play the slot machine? \n type y if you do ')
if choice == 'y':
for i in range(1, 4):
play = random.randrange(1,16)
print play
else:
print 'Pity, you could have won.'

main()

 

 

One comment

Leave a Reply