Question

I need a function that generates and returns a list containing all integers from 0 to...

I need a function that generates and returns a list containing all integers from 0 to 51 (inclusive) where the integers correspond to cards in a deck like this
0 - 3:        2 clubs, diamonds, hearts, spades (in that order)
4 - 7:        3 clubs, diamonds, hearts, spades (in that order)
8 - 11:       4 clubs, diamonds, hearts, spades (in that order)
12 - 15:   5 clubs, diamonds, hearts, spades (in that order)
16 - 19:   6 clubs, diamonds, hearts, spades (in that order)
20 - 23:   7 clubs, diamonds, hearts, spades (in that order)
24 - 27:   8 clubs, diamonds, hearts, spades (in that order)
28 - 31:   9 clubs, diamonds, hearts, spades (in that order)
32 - 35:   10 clubs, diamonds, hearts, spades (in that order)
36 - 39:   11 clubs, diamonds, hearts, spades (in that order)
40 - 43:   12 clubs, diamonds, hearts, spades (in that order)
44 - 47:   13 clubs, diamonds, hearts, spades (in that order)
48 - 51:   14 clubs, diamonds, hearts, spades (in that order)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

def getList():

lst = [i for i in range(1, 52)]

return lst

print(getList())

​​​​​​​

Add a comment
Know the answer?
Add Answer to:
I need a function that generates and returns a list containing all integers from 0 to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • urgent help with python. can somone code this please and show output QUESTION: There are a variety of games possi...

    urgent help with python. can somone code this please and show output QUESTION: There are a variety of games possible with a deck of cards. A deck of cards has four different suits, i.e. spades (*), clubs (*), diamonds (), hearts (), and thirteen values for each suit. Now write a function that uses list comprehension to create a deck of cards. Each element in the list will be a card, which is represented by a list containing the suit...

  • Write in Java! Do NOT write two different programs for Deck and Card, it should be...

    Write in Java! Do NOT write two different programs for Deck and Card, it should be only one program not 2 separate ones!!!!!! !!!!!!!!!!!!!!!Use at least one array defined in your code and two array lists defined by the operation of your code!!!!!!!!!!!!!!!!!!!!! The array should be 52 elements and contain a representation of a standard deck of cards, in new deck order. (This is the order of a deck of cards new from the box.) The 2 Array lists...

  • C++ Your solution should for this assignment should consist of five (5) files: Card.h (class specification...

    C++ Your solution should for this assignment should consist of five (5) files: Card.h (class specification file) Card.cpp (class implementation file) DeckOfCards.h (class specification file) DeckOfCards.cpp (class implementation file) 200_assign6.cpp (application program) NU eelLS Seven UT Diamonds Nine of Hearts Six of Diamonds For your sixth programming assignment you will be writing a program to shuffle and deal a deck of cards. The program should consist of class Card, class DeckOfCards and an application program. Class Card should provide: a....

  • Java programing Write a program that deals a deck of card into 4 hands – Each...

    Java programing Write a program that deals a deck of card into 4 hands – Each hand having 13 cards. The program should be doing the followings use an array to randomly select 52 cards and deal it into 4 hands. Print each hand unsorted Identify the face value of each hand and display it. You should create a class called Card, and all the methods should be defined within the card class. Hints – Import below java utility to...

  • bblem deals with playing cards. The Card API is given below: public class Card ( suit...

    bblem deals with playing cards. The Card API is given below: public class Card ( suit is "Clubs", "Diamonds", "Bearts", or "Spades" Gene=ination s 2", , "10" יי", ,"פ" ,"8" ,"ר" , "6" ,"5י ,-4" ,"ני- * or "A * value is the value of the card number if the card denominat, *is between 2 and 10; 11 for J, 12 for Q, 13 for K, 14 for A public Card (String suit, string denomination){} 1/returns the suit (Clubs, Diamonds,...

  • Program 4: C++ The Game of War The game of war is a card game played by children and budding comp...

    Program 4: C++ The Game of War The game of war is a card game played by children and budding computer scientists. From Wikipedia: The objective of the game is to win all cards [Source: Wikipedia]. There are different interpretations on how to play The Game of War, so we will specify our SMU rules below: 1) 52 cards are shuffled and split evenly amongst two players (26 each) a. The 26 cards are placed into a “to play” pile...

  • Here is a table showing all 52 cards in a standard deck. Color Face cards Suit...

    Here is a table showing all 52 cards in a standard deck. Color Face cards Suit Ace Two Three Four Five Six Seven Eight Nine Ten Jack Queen King Hearts AV 2 3 5 6 8v 9 10 J OV Red 7 3. Red Diamonds 4. 2 3. 4. 5. 6 70 8 9. 10. Jo O K Black Spades 49 29 34 4. 54 64 74 84 94 104 JA KA Black Clubs A4 24 34 44 54 64...

  • While using JAVA , solve this. There are three basic classes we'll need this week: Card:...

    While using JAVA , solve this. There are three basic classes we'll need this week: Card: A class like the one presented in the modules, but with a few changes. Hand: A class that represents the cards held by a single player. Deck: A class that represents the source of the cards for dealing and, as the game progresses, the place from which players can receive new cards (say, as they pick cards "from the deck" or when future hands...

  • E Question 12 A poll showed that 45.7% of Americans say they believe that some psychics...

    E Question 12 A poll showed that 45.7% of Americans say they believe that some psychics can help solve murder cases. What is the probability of randomly selecting someone who does not believe that some psychics can help solve murder cases. Submit Question 0/ Question 13 P && + < . . . As shown above, a classic deck of playing cards is made up of 52 cards, 26 of which are black and the other 26 are red. Each...

  • Write a class named Card which will represent a card from a deck of cards. A...

    Write a class named Card which will represent a card from a deck of cards. A card has a suit and a face value. Suits are in order from low to high: Clubs, Diamonds, Hearts and Spades. The card values from low to high: 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, and Ace. Write a Deck class that contains 52 cards. The class needs a method named shuffle that randomly shuffles the cards in the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT