# Someone Show Python M New Python Text Functions Support Card Game Blackjack 21 Object Game Q26181800

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