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
____ [38]
3 years ago
11

Write a function called play_round that simulates two people drawing cards and comparing their values. High card wins. In the ca

se of a tie, draw more cards. Repeat until someone wins the round. The function has two parameters: the name of player 1 and the name of player 2. It returns a string with format ' wins!'. For instance, if the winning player is named Rocket, return 'Rocket wins!'.
Computers and Technology
1 answer:
elena-s [515]3 years ago
8 0

Answer:

Here you go, Change it however you'd like :)

Explanation:

import random as r

def play_round(p1, p2):

   cards = [1,2,3,4,5,6,7,8,9,10,"J","Q","K","A"]

   play1 = r.choice(cards)

   play2 = r.choice(cards)

   

   while play1 == play2:

       play1 = r.choice(cards)

       play2 = r.choice(cards)

   

   if cards.index(play1) > cards.index(play2):

       return f"{p1}'s Card: {play1}\n{p2}'s Card: {play2}\nThe Winner is {p1}"

   else:

       return f"{p1}'s Card: {play1}\n{p2}'s Card: {play2}\nThe Winner is {p2}"

print(play_round("Bob","Joe"))

You might be interested in
Which of the following types of tool should be used only on round work, such as rigid or IMC conduit?
Dafna11 [192]
Its C. A pipe wrench 
6 0
3 years ago
Read 2 more answers
Convert 192.16.3.1 to a Binary number
jenyasd209 [6]
Converting a decimal number into binary would be:

192/2= 96   remainder=0  
96/2= 48    remainder=0
48/2=24     remainder=0
24/2=12      remainder=0
12/2=6        remainder=0
6/2=3         remainder=0
3/2=1          remainder=1
1/2= 0         remainder=1
The binary number would be: 11 00 00 00

For 16
16/2=8     remainder=0
8/2=4      remainder=0
4/2=2       remainder=0
2/2=1         remainder=0
1/2= 0         remainder=1
The binary would be: 00 01 00 00

For 3
3/2=1       remainder=1
1/2= 0         remainder=1
The binary would be: 00 00 00 11

For 1
1/2= 0         remainder=1
The binary would be: 00 00 00 01

The binary number would be:  
11000000.00010000.00000011.00000001
5 0
4 years ago
You are given two arrays of integers a and b of the same length, and an integer k . We will be iterating through array a from le
rodikova [14]

Answer:

#include <iostream>

using namespace std;

int main(){

   int arr1[5], arr2[5], k = 7;

   arr1 = {1,3,5,3,6}

   arr2 = {1,3,2,4,4}

   int reverseA2[5];

   for (int x = 5; x > 0; x++){

       reverseA2[5-x] = arr2[x-1];

   }

   for (int i = 0; i < 5; i++){

       if ( arr1[i] + reverseA2[i] < k){

           cout<< arr1[i] << " , "<<reverseA2[i];

       }

   }

}

Explanation:

The C++ source code prints a pair of values from the arr1 and reverse arr2 arrays whose sum is less than the value of the integer variable value k.

4 0
3 years ago
Tell me 5 jokes. its for my comdey class
Lubov Fominskaja [6]
If you have 13 apples in one hand and 10 oranges in the other, what do you have?

Big hands.

7 0
3 years ago
I have been trying to use brainly recently but i cant because everytime i watch an ad to get an answer, its an interactive ad, s
Troyanec [42]

Answer:

remove ads

Explanation:

by buying a no ad pack

5 0
2 years ago
Other questions:
  • 5) How have the wireless web and peer-to-peer networking helped small businesses compete with large corporations?
    15·2 answers
  • Research different ways that 3D printing is used in society. Tell us about the items that are 3D printed.
    8·2 answers
  • Which of the following is not an example of a technological aid?
    11·1 answer
  • What role/service is windows 2012 server backup part of?
    5·1 answer
  • Discuss the infrastructure necessary for the Internet of Things and Cloud computing to exist. What unique services does this ena
    7·1 answer
  • What is the difference between the Internet and the World Wide Web? Explain in your own words.
    13·2 answers
  • 20 POINTSS!! NEED HELP!!
    12·2 answers
  • If a student passes off an author’s work as his or her own, the student has
    6·1 answer
  • Why big data influnce the rise of AI<br><br>​
    8·2 answers
  • Rr lyrae stars pulsate, but with shorter periods and lower luminosities than cepheids. true false
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!