Let’s look at your class.
There are multiple design mistakes.
1. Card should not evaluate it’s value, since a value of card defined by the game. Basically, if you would like to reuse this class for say Poker you would have to create a child class for the Card just to evaluate its value for a different game, which is wrong.
2. In your case, Card class knows about suits and ranks, which is also in my opinion wrong solution, since you might use any other deck except for French.
So as a result of first 2 problems, it turns out that blackjack python your Card is just a container(structure) without any logics inside, one of the best things to use for that in python in
Now let’s talk about
1. Deck is definitely not a child, is sort of collection of cards.
2. Your and methods should be combined into single one called .
3. Since now we know that is not a then the most right place to keep track of ranks and suits is .
Here is example:
Now things like play_game, card_value(hand_value?) and other things/rules related to specific game should be defined by class
So in the end what we have as a game skeleton is this: