File Edit Format Run Options Window Help dCardNames dCardValues ['2', '3', '4', '5', '6', = ['2', '3', '4', '5', '6' 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: i = 0 while aCards [0] [i] aCards [0] [i+13] aCards [0] [i + 26] aCards [0] [i + 39] = dCardNames[i] i=i+1 aCards [1] [i] = dSuits [0] aCards [1] [i+13] aCards [1] [i+26] = dSuits [2] aCards [1] [i + 39] aCards [2] [i] aCards [2] [i+13] = = dSuits [3] dCardValues [i] dCardNames[i] dCardNames [i] dCardNames[i] dSuits [1] i < 52: print (aCards [0] [i], i = i + 1 '9', '10', 'J', 'Q','K','A'] '8', '9', '10', '10', '10', '10', '11'] " aCards [2] [i+26] =dCardValues[i] aCards [2] [i + 39] = dCardValues[i] dCardValues[i] " aCards [1] [i], " aCards [2] [i])
File Edit Format Run Options Window Help dCardNames dCardValues ['2', '3', '4', '5', '6', = ['2', '3', '4', '5', '6' 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: i = 0 while aCards [0] [i] aCards [0] [i+13] aCards [0] [i + 26] aCards [0] [i + 39] = dCardNames[i] i=i+1 aCards [1] [i] = dSuits [0] aCards [1] [i+13] aCards [1] [i+26] = dSuits [2] aCards [1] [i + 39] aCards [2] [i] aCards [2] [i+13] = = dSuits [3] dCardValues [i] dCardNames[i] dCardNames [i] dCardNames[i] dSuits [1] i < 52: print (aCards [0] [i], i = i + 1 '9', '10', 'J', 'Q','K','A'] '8', '9', '10', '10', '10', '10', '11'] " aCards [2] [i+26] =dCardValues[i] aCards [2] [i + 39] = dCardValues[i] dCardValues[i] " aCards [1] [i], " aCards [2] [i])
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
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 (explain) your code.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 8 steps with 6 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education