Python 3.6.3 - 二十一点

时间:2017-12-17 14:05:55

标签: python-3.x blackjack

我正在编写一个关于python 3.6.3的二十一点游戏,我蚂蚁指定这个:

def total(hand):
    total = 0
    for card in hand:
        if card == "J" or card == "Q" or card == "K":
            total+= 10
        elif card == "A":
            if total >= 11:
                total+= 1
            else:
                total+= 11
    else:
        total += card
    return total

但它说我有一个错误:TypeError: unsupported operand type(s) for +=: 'int' and 'tuple'

有人可以帮助我吗?

0 个答案:

没有答案