Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the attached python code, use the array built to shuffle and deal two poker hands. Change the corresponding values for all jacks through Aces

In the attached python code, use the array built to shuffle and deal two poker hands. Change the corresponding values for all jacks through Aces to 11, 12, 13, 14 respectively.

Shuffle the deck, then deal two hands. Comment your code and submit the python code.

dCardNames = ['2','3','4','5','6','7','8','9','10','J','Q','K','A'] dCardValues = ['2','3','4','5','6','7','8','9','10','10','10','10','11'] dSuits = ["Clubs","Spades","Diamonds","Hearts"] #Build a two dimensional deck with Cards suits and values. aCards = [[" for i in range(52)] for j in range(3)] i = 0 n = 0 while i < 13: aCards[0][i] = dCardNames[i] aCards[0][i + 13] = dCardNames[i] aCards[0][i + 26] = dCardNames[i] aCards[0][i + 39] = dCardNames[i]

aCards[1][i] = dSuits[0] aCards[1][i + 13] = dSuits[1] aCards[1][i + 26] = dSuits[2] aCards[1][i + 39] = dSuits[3] aCards[2][i] = dCardValues[i] aCards[2][i + 13] = dCardValues[i] aCards[2][i + 26] = dCardValues[i] aCards[2][i + 39] = dCardValues[i]

i = i + 1

i = 0 while i < 52: print(aCards[0][i], " ",aCards[1][i], " ",aCards[2][i]) i = i + 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

apply research strategies to writing.

Answered: 1 week ago

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago