Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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())
Comment

PREVIOUS NEXT
Code Example
Python :: how to stop code in ursina 
Python :: splittext py 
Python :: remove too short strings from a list python 
Python :: drop null rows pandas 
Python :: ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject 
Python :: # list all keywords in Python 
Python :: django check if user is staff in template 
Python :: max int value in python 
Python :: datetime python timezone 
Python :: python json parse 
Python :: equivalent of setInterval python 
Python :: make selenium headless python 
Python :: schedule task to midnight python 
Python :: how to change cursor on hover of button in tkinter 
Python :: open applications by python 
Python :: sns save chart 
Python :: python write to text file with new line 
Python :: how to sharpen image in python using cv2 
Python :: how does sns boxplot determine outliers 
Python :: extract image from pdf python 
Python :: create directory python if not exist 
Python :: create folder python 
Python :: tqdm gui 
Python :: python install tabulate 
Python :: discord.py on command error 
Python :: export sklearn.metrics.classification_report as csv 
Python :: df to np array 
Python :: coronavirus program in python 
Python :: colored text python 
Python :: install django windows 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =