Question: what python code do i use? Question 5: Deck of cards Write a list comprehension that will create a deck of cards, given a list
Question 5: Deck of cards Write a list comprehension that will create a deck of cards, given a list of suits and a list of numbers. Each element in the list will be a card, which is represented by a 2-element list of the form (suit, number). def decksuits, numbers): "Creates a deck of cards (a list of 2-element lists) with the given suits and numbers. Each element in the returned list should be of the form suit, number). >>> decki's', 'C'), (1, 2, 3]) It's', 11, 'S', 21. I'S', 3), I'C. 1), I'C', 21, I'C', 311 >>> deck(['S', 'C'), 13, 2, 11) [I'S', 31, 'S', 2). I'S', 11, ('C', 3). I'C', 2), (C, 1)] >>> deck 11, 13, 2, 1]) U >>> deck(L'S', 'c'l. 1) [] " YOUR CODE HERE ** Use OK to test your code: python3 ok - deck
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
