📌  相关文章
📜  如何使用 for 循环在列表中获取 2 个随机输入 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:08.171000             🧑  作者: Mango

代码示例1
import random
def deal_card():
    cards = [11,2,3,4,5,6,7,8,10,10,10,10]
    card = random.choice(cards)
    return card
User_cards = []
Comuputer_cards = []
gameover = False
for _ in range(2):
    Comuputer_cards.append(deal_card())
    User_cards.append(deal_card())