Question: In Python 3, create a class called Deck that has methods for shuffling and drawing a card. I already have a class for the playing

In Python 3, create a class called Deck that has methods for shuffling and drawing a card. I already have a class for the playing card so I'll paste it below. I just need the other class to shuffle those cards and draw one.

#Playing card class class PlayingCard: def __init__(self, face, suit): #Creating a dictionary for the faces self.cardFaces = {'2':0, '3':1, '4':2, '5':3, '6':4, '7':5, '8':6, '9':7, '10':8, 'Jack':9, 'Queen':10, 'King':11, 'Ace':12 } #Creating a dictionary for the suits self.cardSuits = {'Spades':0, 'Clubs':1, 'Diamonds':2, 'Hearts':3} #Initializing them to the parameter self.face = self.cardFaces[face] self.suit = self.cardSuits[suit]

#Function to return the face def getFace(self): return self.face

#Function to return the suit def getSuit(self): return self.suit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!