Hi all,
 
What's the invalid syntax? Here is the code:
import random
hand = {
    '0' : ["Ace"]
    '1' : ["Two"]
    '2' : ["Three"]
    '3' : ["Four"]
    '4' : ["Five"]
    '5' : ["Six"]
    '6' : ["Seven"]
    '7' : ["Eight"]
    '8' : ["Nine"]
    '9' : ["Ten"]
    '10' : ["Jack"]
    '11' : ["Queen"]
    '12' : ["King"]
    }
types = {
    '0' : ["Diamonds"]
    '1' : ["Hearts"]
    '2' : ["Spades"]
    '3' : ["Clubs"]
    }
playercards = [a,b,c,d,e]
t = [t1,t2,t3,t4,t5]
def menu():
    print "1. Deal a hand"
    print "2. Exit"
 
def option():
    return int(raw_input("Option: "))
 
def deal():
    playercards = random.choice(13)
    t = random.choice(4)
 
print "The Five Card Dealer"
print "By Nathan Pinno"
while 1:
    menu()
    opt = option()
    while opt == 1:
        deal()
        for index in range(len(playercards)):
            if index == 0:
                index = hand['0']
            if index == 1:
                index = hand['1']
            if index == 2:
                index = hand['2']
            if index == 3:
                index = hand['3']
            if index == 4:
                index = hand['4']
            if index == 5:
                index = hand['5']
            if index == 6:
                index = hand['6']
            if index == 7:
                index = hand['7']
            if index == 8:
                index = hand['8']
            if index == 9:
                index = hand['9']
            if index == 10:
                index = hand['10']
            if index == 11:
                index = hand['11']
            if index == 12:
                index = hand['12']
        for indice in range(len(t)):
            if indice == 0:
                indice = types['0']
            if indice == 1:
                indice = types['1']
            if indice == 2:
                indice = types['2']
            if indice == 3:
                indice = types['3']
        print a," of ",t1, b," of ",t2, c," of ",t3, d," of ",t4, e," of ",t5
    while opt == 2:
        break
print "Goodbye."
If it helps it highlighted the ' after 1 in the hand dictionary.
 
Thanks,
Nathan Pinno,
Crew, Camrose McDonalds and owner/operator of Zoffee
BEGIN:VCARD
VERSION:2.1
N:Pinno;Nathan;Paul;Mr.
FN:Pinno, Nathan Paul
NICKNAME:Spam_swatter
ORG:Woffee;Executive
TITLE:Owner/operator
TEL;WORK;VOICE:7806085529
TEL;CELL;VOICE:7806085529
ADR;WORK:;President/CEO;Box 1783;Camrose;Alberta;T4V1X7;Canada
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:President/CEO=0D=0ABox 1783=0D=0ACamrose, Alberta T4V1X7=0D=0ACanada
ADR;HOME:;;Box 1783;Camrose;Alberta;T4V1X7;Canada
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:Box 1783=0D=0ACamrose, Alberta T4V1X7=0D=0ACanada
X-WAB-GENDER:2
URL;HOME:http://falcon3166.tripod.com
URL;WORK:http://zoffee.tripod.com
BDAY:19850221
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20050805T205644Z
END:VCARD
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to