1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tangare [24]
3 years ago
12

A poker hand consists of 5 cards drawn at random without replacement from a 52 card deck. Using python and the cards data frame

you imported, draw a poker hand by sampling from the cards and displaying the resulting sample.
Computers and Technology
1 answer:
PSYCHO15rus [73]3 years ago
5 0

Answer:

# Python program to shuffle a deck of card

# importing modules

import itertools, random

# make a deck of cards

deck = list(itertools.product(range(1,14),['Spade','Heart','Diamond','Club']))

# shuffle the cards

random.shuffle(deck)

# draw five cards

print("You got:")

for i in range(5):

  print(deck[i][0], "of", deck[i][1])

Output

You got:

5 of Heart

1 of Heart

8 of Spade

12 of Spade

4 of Spade

Explanation:

You might be interested in
In addition to being fun, another reason that people have been creating games ever since they settled into communities is:
aleksklad [387]

Answer:

I am pretty sure it's D. to teach strategy and critical thinking.

6 0
2 years ago
Read 2 more answers
What was the first e-commerce service?
docker41 [41]

The first e-commerce service would be A)Banking. Hope this helps.

8 0
3 years ago
Your ipad has an application that will not stop running. what feature/tool can you use to stop it? kill treason task manager for
saveliy_v [14]

you could force quit

6 0
2 years ago
Read 2 more answers
A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the
Fynjy0 [20]

Answer:

# include <iostream.h>

# include <stdio.h>

# include <string.h>

using namespace std;

class citizen

{      

    int i;

    public string name[30];

    public long int phonenumber[30];

    public void addindividual(string name1)

     {      

           If (i<=30)

            {     int flag=0;

                  for(int j=0; j<=i;j++)

                  {

                     if (strcmp(name[i], name1)

                      {

                          flag=1;

                      }

                     else

                     {  

                           flag=0;

                     }

                  }

                  If (flag)

                 {

                  if (i<30)

                  {

                  for(j=i+1;j<=30; j++)

                  {

                        cout<<"Enter the name:"; getchar(name[j]);

                        cout<<"Enter the phone number:"; cin>>phonenumber[j];

                         i++;

                   }

                  else  

                   {

                        cout<<"The person already exists";

                        exit();

                   }

              }

            else

             {

                 cout<<"array is full:";

                 exit();

             }

     }

}

Void main()

{

     string str;

    cout<<" Enter name:";

    getline(cin, str); ;

     citizen c1=new citizen();

     c1.addindividual(name1);

}

Explanation:

With a little more effort you can make the program allow the user to enter any number of details, but less than 30 overall. We have used here flag, and as a programmer we know why we use the Flag. It is used to check whether certain Boolean condition is fulfilled or not. Here, we are checking whether a given name is present in the array of names, and if it is not present, we add that to the list. And if the name is present, we print, it already exist.

4 0
2 years ago
If you want an app to reach the largest possible audience, which two platforms should you use?
Papessa [141]

Android Studio for Android, and Xcode for Apple devices.

6 0
2 years ago
Other questions:
  • What operating system allows various teams in its office to network and collaborate on projects
    5·1 answer
  • A loop that repeats a specific number of times is known as a(n):
    9·1 answer
  • A technician is dispatch to troubleshoot a user's computer.
    12·1 answer
  • Where is line-of-sight Internet common?<br> In space<br> Outdoors<br> Inside<br> In businesses
    10·1 answer
  • Website administrators relay on ______, which is data such as the number of users who commented on, shared, viewed, or liked web
    7·2 answers
  • Which of the following describes colors, spacing, borders, and other effects that change the appearance of a table?
    5·1 answer
  • Java-Script Concept quiz:
    6·1 answer
  • State the functions of all the parts of the computer​
    14·1 answer
  • When adjusting the aperture, an F-stop of F32 lets in more light then a setting of F8
    10·1 answer
  • Electrical data suitable for transmission is called a(n)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!