File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 66dl = []
77
88# Check Blackjack__________________________________________
9- def BlackJack (s ):
9+ def check_Twenty_One (s ):
1010 if s == 21 :
1111 return True
1212 else :
@@ -68,8 +68,13 @@ def playersTurn(s):
6868
6969 s = check_sum (s )
7070
71- if (BlackJack (s )):
72- print ("Hurray......It's a BLACKJACK....You Won\n " )
71+ if (check_Twenty_One (s )):
72+ #Check Blackjack_______________________________________
73+ if len (pl ) == 2 :
74+ print ("Hurray......It's a BLACKJACK....You Won\n " )
75+ #Check if player made 21_______________________________
76+ else :
77+ print ("Awesome!!!......You made 21!....You Won\n " )
7378 return 2
7479 elif (Bust (s )):
7580 print ("You got Bust.....You Lost\n " )
@@ -123,8 +128,11 @@ def playersTurn(s):
123128 print (f"\n Dealer's current hand: { dl } \n " )
124129
125130 s = check_sum (s )
126- if (BlackJack (s )):
127- print ("Dealer got a BlackJack and won the Game\n You Lost\n " )
131+ if (check_Twenty_One (s )):
132+ if len (dl ) == 2 :
133+ print ("Dealer got a BlackJack and won the Game\n You Lost\n " )
134+ else :
135+ print ("Dealer made 21 and won the Game\n Better Luck Next Time!\n " )
128136 break
129137 elif (Bust (s )):
130138 print ("Dealer got Busted\n You Won\n " )
You can’t perform that action at this time.
0 commit comments