#!/usr/bin/env python
# coding: utf-8
# # Pick a Random Card using Python
# In[8]:
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())
#clcoding.com
# In[ ]:
0 Comments:
Post a Comment