Question: Formulate a function called draw_three which takes a list of cards (list_of_cards) and returns a list of the first three cards. Note that this function

Formulate a function called draw_three which takes a list of cards (list_of_cards) and returns a list of the first three cards. Note that this function does not print anything, only returns a list of strings. Also note that it should handle any number of cards, not necessary a full deck, but you can safely assume it will be at least 3 cards. For example, if passed the list 'Ace of Hearts', 'Jack of Spades', '10 of Diamonds', 'Queen of Clubs', 'Ace of Clubs' the function would return ['Ace of Hearts', 'Jack of Spades', '10 of Diamonds'].

Important: once again, you may not use any shortcuts (such as sum), use a loop.

Step by Step Solution

3.44 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

You can create the drawthree function in Python using a loop to extract the fi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!