mardi 19 novembre 2019

Black jack but #TypeError: 'type' object is not subscriptable

I'm trying to do a black jack game like this (one part of it) but i have no idea of making it work)

A = 1
J = 10
Q = 10
K = 10
hand = 0
deck = [
    1, 1, 1, 1, 2, 2, 2, 2, 
    3, 3, 3, 3, 4, 4, 4, 4, 
    5, 5, 5, 5, 6, 6, 6, 6, 
    7, 7, 7, 7, 8, 8, 8, 8, 
    9, 9, 9, 9, 10, 10, 10, 10, 
    10, 10, 10, 10, 10, 10, 10, 10
]
foo = random.SystemRandom()
draw = foo.randint(deck)
hand += (draw)
print(hand)

I've tried setting deck as a str, int and float but i personally don't know what to do.




Aucun commentaire:

Enregistrer un commentaire