import random def deal_card(): cards = [11,2,3,4,5,6,7,8,10,10,10,10] card = random.choice(cards) return card
Here is what the above code is Doing:
1. It creates a list of cards.
2. It chooses a random card from the list.
3. It returns the card.
import random def deal_card(): cards = [11,2,3,4,5,6,7,8,10,10,10,10] card = random.choice(cards) return card
Here is what the above code is Doing:
1. It creates a list of cards.
2. It chooses a random card from the list.
3. It returns the card.