Skip to content

Blackjack

Andrew Burke edited this page Apr 3, 2024 · 7 revisions

def blackjack(score):

if score < 17:

print("Hit Me!")

elif score < 21:

print("Nice hand!")

elif score >= 21:

print("Bust!")

else:

print("Blackjack!")

blackjack(21) # Output: "Blackjack!"

blackjack(19) # Output: "Nice hand!"

blackjack(10) # Output: "Hit me!"

blackjack(25) # Output: "Bust!"

Clone this wiki locally