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.
You're initially dealt 2 cards, before you hit or stay, not one.break if userChoice S userStick True if userAce True: aceNumber input Do you want your ace to be a 1 or and 11 if aceNumber "11 userTotal userTotal 10 elif aceNumber "1 userTotal userTotal else: print I did not understand that number, so one has.Return (w_deck)-1) def remove_card(self, card move(card).Here is example: class Deck: card_ranks card_suits def _init self rds fresh_deck def refresh_deck(self rds list(map(Card, product(rd_ranks, rd_suits) def shuffle(self shuffle(rds) def draw_card(self return rds.I recently started python (3.7) in school and my most recent assignment is to create a simple blackjack game.eep(0.5) print (userTotal) if userTotal 21: userBust True print You have bust!Append(j ' horario del sorteo de la lotería nacional de hoy of ' i) def new_card(self #instead of return, use yield?
Deck is definitely not a Card child, Deck is sort of collection of cards.Let's look at your Card class.So as a result of first 2 problems, it turns out that your Card is just a container(structure) without any logics inside, one of the best things to use for that in python in namedtuple from collections import namedtuple, card namedtuple Card rank 'suit now.Card should not evaluate it's value, since a value of card defined by the game.Your indentation is not always consistent, but you consistently use some form of similar indentation, so your code is very easy to read through.Let's hope your teacher doesn't know how to play blackjack!Since now we know that Deck is not a Card then the most right place to keep track of ranks and suits is Deck.print (userTotal) break #Allows the dealer to twist or stick while cpuStick False: cpuTotal cpuNumTwo if cpuTotal 17: cpuNumThree random.
Randint(1,13) if userNumThree 11 or userNumThree 12 or userNumThree 13: userNumThree 10 userTotal userTotal userNumThree print Your next card.
if userChoice T userNumThree random.