awacke1 commited on
Commit
4bf01c6
1 Parent(s): f7450ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -57,7 +57,11 @@ game_deck, dealer, player, game_play = start_game()
57
 
58
  def display_pro_tip(player, dealer):
59
  player_total = sum(card.rank for card in player.cards)
60
- dealer_upcard = dealer.cards[0].rank
 
 
 
 
61
 
62
  if player_total <= 11:
63
  return "Pro Tip: With a total of 11 or less, it's generally advisable to hit."
@@ -70,7 +74,11 @@ def display_pro_tip(player, dealer):
70
 
71
  def display_betting_strategy(player, dealer):
72
  player_total = sum(card.rank for card in player.cards)
73
- dealer_upcard = dealer.cards[0].rank
 
 
 
 
74
 
75
  if player_total <= 11:
76
  return "Betting Strategy: Consider increasing your bet when your total is 11 or less."
 
57
 
58
  def display_pro_tip(player, dealer):
59
  player_total = sum(card.rank for card in player.cards)
60
+
61
+ if dealer.cards:
62
+ dealer_upcard = dealer.cards[0].rank
63
+ else:
64
+ dealer_upcard = 0
65
 
66
  if player_total <= 11:
67
  return "Pro Tip: With a total of 11 or less, it's generally advisable to hit."
 
74
 
75
  def display_betting_strategy(player, dealer):
76
  player_total = sum(card.rank for card in player.cards)
77
+
78
+ if dealer.cards:
79
+ dealer_upcard = dealer.cards[0].rank
80
+ else:
81
+ dealer_upcard = 0
82
 
83
  if player_total <= 11:
84
  return "Betting Strategy: Consider increasing your bet when your total is 11 or less."