Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created April 26, 2021 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/299ee5a833eb80429e4ffa0f7600f8fd to your computer and use it in GitHub Desktop.
Save amankharwal/299ee5a833eb80429e4ffa0f7600f8fd to your computer and use it in GitHub Desktop.
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