File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,11 +67,21 @@ def blackjack(dealer_hand, player_hand):
6767 time .sleep (1 )
6868 play_again ()
6969
70+ def both (dealer_hand , play_again ):
71+ if total (player_hand ) >= 22 and total (dealer_hand ) >= 22 :
72+ print_results (dealer_hand , player_hand )
73+ time .sleep (1 )
74+ print ("Both you and the dealer bust!" )
75+
7076def score (dealer_hand , player_hand ):
7177 if total (player_hand ) == 21 :
7278 print_results (dealer_hand , player_hand )
7379 time .sleep (1 )
7480 print ("Congratulations! You got a Blackjack!\n " )
81+ elif total (player_hand ) >= 22 and total (dealer_hand ) >= 22 :
82+ print_results (dealer_hand , player_hand )
83+ time .sleep (1 )
84+ print ("Both you and the dealer bust!" )
7585 elif total (dealer_hand ) == 21 :
7686 print_results (dealer_hand , player_hand )
7787 time .sleep (1 )
@@ -91,7 +101,7 @@ def score(dealer_hand, player_hand):
91101 elif total (player_hand ) > total (dealer_hand ):
92102 print_results (dealer_hand , player_hand )
93103 time .sleep (1 )
94- print ("Congratulations. Your score is higher than the dealer. You win\n " )
104+ print ("Congratulations. Your score is higher than the dealer. You win\n " )
95105
96106def game ():
97107 choice = 0
You can’t perform that action at this time.
0 commit comments