X1255: Blackjack

Write a function in Python that implements the following logic: Given 2 int values a and b greater than 0, return whichever value is nearest to 21 without going over. Return 0 if they both go over.

Examples:

blackjack(2,4) -> 4
blackjack(22,14) -> 14

Your Answer:

Reset

Practice a different Python exercise

Feedback

Your feedback will appear here when you check your answer.