Answers for "how to get 2 random inputs in a list using for loop"

3

how to get 2 random inputs in a list using for loop

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())
Posted by: Guest on August-28-2021

Code answers related to "how to get 2 random inputs in a list using for loop"

Python Answers by Framework

Browse Popular Code Answers by Language