Question: (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
(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
3.46 Rating (159 Votes )
There are 3 Steps involved in it
Python version 38 cardspy Python program that simulates the se... View full answer
Get step-by-step solutions from verified subject matter experts
