【发布时间】:2016-08-17 22:13:04
【问题描述】:
我正在尝试在 python 中制作二十一点游戏。就像 7s 的值是 7 但千斤顶的值是 10 所以:
cards = ['ace','king','queen'....'3','2'
firstCard = random.choice(cards)
secondCard = random.choice(cards); remove.cards(firstCard)
print(int(firstCard) + int(secondCard))
非常适合数字
我怎么能为国王或王牌做到这一点......
【问题讨论】:
-
您好,欢迎来到 StackOverflow。请花一些时间阅读帮助页面,尤其是名为"What topics can I ask about here?" 和"What types of questions should I avoid asking?" 的部分。更重要的是,请阅读the Stack Overflow question checklist。您可能还想了解Minimal, Complete, and Verifiable Examples。
标签: python python-3.x