Question
Question: STEP 1- The First Function: Draw A Poker Card 2- The Second Function: Calculate The Points Requirements: Input: None - Generate A STEP 1-
Question:STEP 1- The First Function: Draw A Poker Card 2- The Second Function: Calculate The Points Requirements: Input: None - Generate A
STEP 1- the first function: draw a poker card 2- the second function: calculate the points Requirements: input: None - Generate a number in the range [1, 52] inclusive. - If this number is in [1-13], the card name will be ace_of_clubs, 2_of_clubs, ..., 10_of_clubs, jack_of_clubs, queen_of_clubs, and king_of_clubs in order - If this number is in [14-26], the card name will be ace_of_diamonds 2_of_diamonds ..., 10_of_diamonds, jack_of_diamonds, queen_of_diamonds, and king_of_diamonds in order - If this number is in [27-39], the card name will be one of ace_of_hearts, 2_of_hearts, ..., 10_of_hearts, jack_of_hearts, queen_of_hearts, and king_of_hearts in order - If this number is in [40-52], the card name will be one of ace_of_spades, 2_of_spades, ..., 10_of_spades, jack_of_spades, queen_of_spades, and king_of_spades in order return: the random card name (str type) hint: The card name can be composed by three parts: - face_name + "_of_" + suit_name
STEP 2- input: a_card_name(str) conversion: - ace: 11 points - jack: 10 points - queen: 10 points - king: 10 points - others: points = card face number return: the points (int) hint: The card points can be got only from the first part of a card name: for example: '4_of_club'.split("_")[0] is the string '4'
STEP 3- Test them draw a card from the first function, return a card name call the second function with the card above as input, return the points draw second card and find its points, then print out the each card's name, points and total points.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started