Question: Python Program 3. Random Card (10 points): There are many games and situations in which we would like to pick a random card from a
Python Program

3. Random Card (10 points): There are many games and situations in which we would like to pick a random card from a deck of cards. In a programming language like Python, we can implement this by randomly choosing an integer in the range 0...51, and mapping this integer to a card. This mapping can be done as follows: Numbers 0 - 12 represent Clubs, 13 25 represent Diamonds, 26 38 represent Hearts, and 39 - 51 represent Spades. Within each of these ranges, the first number represents an ace, the second two, then three, and so on up to ten, jack, queen and king. For example, the number 37 will be Queen of Hearts, while the number 17 is Five of Diamonds. Please create a Python program random-card.py that randomly displays an integer in the range 0...51 along with its corresponding card. The numbers 2 through 10 should be dis- played using their English word representation. Use Ace, Jack, "Queen" and "King" to display the other cards. Two example outputs are shown below. Sample Output: Random Number: 37 This card is : Queen of Hearts Random number: 15 This card is Three of Diamonds As a hint, consider what arithmetic operations can give you the suit and the number of the card. There is an easy way to determine suit and rank with just basic arithmetic
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
