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

Solutions on MaxInterview for how to get 2 random inputs in a list using for loop by the best coders in the world

showing results for - "how to get 2 random inputs in a list using for loop"
Léo
12 Mar 2017
1import random
2def deal_card():
3    cards = [11,2,3,4,5,6,7,8,10,10,10,10]
4    card = random.choice(cards)
5    return card
6User_cards = []
7Comuputer_cards = []
8gameover = False
9for _ in range(2):
10    Comuputer_cards.append(deal_card())
11    User_cards.append(deal_card())