Skip to content

Instantly share code, notes, and snippets.

@amankharwal

amankharwal/pick a card.py Secret

Created Apr 26, 2021
Embed
What would you like to do?
import random
cards = ["Diamonds", "Spades", "Hearts", "Clubs"]
ranks = [2, 3, 4, 5, 6, 7, 8, 9, 10, "Jack", "Queen", "King", "Ace"]
def pick_a_card():
card = random.choices(cards)
rank = random.choices(ranks)
return(f"The {rank} of {card}")
print(pick_a_card())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment