Can someone show me how to do this in python? I’m so new topython.

TEXT
The functions are to support the card game of Blackjack or 21

The object of the game is to have a hand that adds up to 21points, or as close to 21 as possible without going over

The 2 through 10 cards are worth the same number of points

The face cards are each worth 10 points

An ace can be worth either 1 or 11 points, whichever isbetter

Ex: a hand of a king, a 3 and an ace is worth 14 points (scoringthe ace as 11 points would go over the limit of 21)

Suits (spades, hearts, diamonds, clubs) do not affect thescore

Specific to this assignment,

Cards are represented as a tuple of the value (an int)and a suit (a string) – you cannot modify an existing tuple’svalues, so this prevents us from accidentally adding more elementsto a card

A hand is represented as a list of Cards (you can add on tolists using the append method). We want to be able tomodify a hand so when dealing cards, we can add a card to ahand.

The deck is also a list

Overall, note that you should not use Python’s print to do anyof these functions. You may find it useful to print out debugginginformation, but these are all functions that return values. (Inany language, if you are asked to write a function that returns thesum of its arguments, you cannot just print the sum, which does notreturn anything that other parts of the program could use. Usingcout or System.out.print would be wrong.)

The functions:

deal(deck, hands)

deck is a list of cards

hands is a tuple of empty hands

distribute the cards in alternating order to all of thehands

Returns the updated hands parameter

score(hand)Returns the number of points of the hand

Count Aces as 1 only if the point total would otherwise be over21 – ex: 2 aces counts as 12

Return 0 for an empty hand

This assignment is intended to give you a first taste of Python. You are required to implement the following functions, though of course you may write other functions to help you complete the task. The functions are to support the card game of Blackjack or 21 o The object of the game is to have a hand that adds up to 21 points, or as close to 21 as possible without going over The 2 through 10 cards are worth the same number of points The face cards are cach worth 10 points o An ace can be worth cither1 or 1 points, whichever is better Ex: a hand of a king, a 3 and an ace is worth 14 points (scoring the ace as 11 points would go over the limit of 21) suits (spades, hearts, diamonds, clubs) do not affect the score .Specific to this assignment, o Cards are represented as a tuple of the value (an int) and a suit (a string)-you cannot modify an existing tuplc’s values, so this prevents us from accidentally adding more clements to a card o A hand is represented as a list of Cards you can add on to lists using the a end method). We want to be able o modify a hand so when dealing cards, we can add a card to a hand. The dcck is also a list Overall, note that you should not use Python’s print to do any of these functions. You may find it useful to print out debugging information, but these are all functions that return values. (In any language, if you are asked to write a function that rcturns the sum of its arguments, you cannot just print the sum, which docs not return anything that other parts of the program could use. Using cout or System.out.print would be wrong.) The functions: deal (deck, hands) o deck is a list of cards o hands is a tuple of empty hands distribute the cards in alternating order to all of the hands o Returns the updated hands parameter score (hand) Returns the number of points of the hand 5 Count Accs as 1 only if the point total would othcrwise be ovcr 21 -cx: 2 aces counts as 12 o Retum 0 for an empty hand Show transcribed image text This assignment is intended to give you a first taste of Python. You are required to implement the following functions, though of course you may write other functions to help you complete the task. The functions are to support the card game of Blackjack or 21 o The object of the game is to have a hand that adds up to 21 points, or as close to 21 as possible without going over The 2 through 10 cards are worth the same number of points The face cards are cach worth 10 points o An ace can be worth cither1 or 1 points, whichever is better Ex: a hand of a king, a 3 and an ace is worth 14 points (scoring the ace as 11 points would go over the limit of 21) suits (spades, hearts, diamonds, clubs) do not affect the score .Specific to this assignment, o Cards are represented as a tuple of the value (an int) and a suit (a string)-you cannot modify an existing tuplc’s values, so this prevents us from accidentally adding more clements to a card o A hand is represented as a list of Cards you can add on to lists using the a end method). We want to be able o modify a hand so when dealing cards, we can add a card to a hand. The dcck is also a list Overall, note that you should not use Python’s print to do any of these functions. You may find it useful to print out debugging information, but these are all functions that return values. (In any language, if you are asked to write a function that rcturns the sum of its arguments, you cannot just print the sum, which docs not return anything that other parts of the program could use. Using cout or System.out.print would be wrong.) The functions: deal (deck, hands) o deck is a list of cards o hands is a tuple of empty hands distribute the cards in alternating order to all of the hands o Returns the updated hands parameter score (hand) Returns the number of points of the hand 5 Count Accs as 1 only if the point total would othcrwise be ovcr 21 -cx: 2 aces counts as 12 o Retum 0 for an empty hand