Question: Desired language is Python. Problem 3. (Playing Card) Write a program card.py that simulates the selection of a random card from a standard deck of
Problem 3. (Playing Card) Write a program card.py that simulates the selection of a random card from a standard deck of 52 playing cards, and writes it to standard output. Hints ** Set rank to a random integer from (2,14] ** Use an if statement to set rankStr to a string corresponding to rank - the ranks are 2, 3, ..., Jack, Queen, King, and Ace ** Set suit to a random integer from [1,4] * Use an if statement to set suitStr to a string corresponding to suit - the suits are Clubs, Diamonds, Hearts, and Spades Compute and write the desired output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
