BlackJack
Lesson 8 of 12 in Coddy's Python Interview Series course.
Challenge
MediumWrite a function blackjack that gets,
a1- integera2- integera3- integer
Given three integers between 1 and 11,If their sum is less than or equal to 21, return their sum.
If their sum exceeds 21 and there's an eleven, reduce the total sum by 10.
Finally, if the sum (even after adjustment) exceeds 21, return 'BUST'
Example:
Input - 5,6,7
Expected Output - 18
Try it yourself
def blackjack(a1, a2, a3):
# Write code hereAll lessons in Python Interview Series
1Crack Python Coding Interview
Lesser of two evensPangram Unique ElementsAnimal CrackersSpy GameMatching StringPalindrome or NotBlackJackFind DuplicatesEncodeHash 33First Non-Repeating Character