Question: Using wing101 Will upvote thanks Use the function design recipe to develop a function named blackjack. This function has two parameters named a and b.
Using wing101 Will upvote thanks
Use the function design recipe to develop a function named blackjack. This function has two parameters named a and b. Both parameters are positive integers. The function returns whichever value is closest to 21 without being over 21 . It returns 0 if both values are over 21 . Some examples: - If the values of a and b are 19 and 20 , the function returns 20 . - If the values of a and b are 15 and 21 , the function returns 21 . - If the values of a and b are 17 and 22 , the function returns 17. - If the values of a and b are 24 and 22 , the function returns 0 . Your function definition must have type annotations and a complete docstring. You are permitted to use local variables, although they aren't necessary. A function that uses Boolean operators will be shorter than one that does not. Type the function definition below the comment, \# Exercise 4. Use the Python shell to test blackjack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
