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
What are some of the ways you can use bitlocker encryption? (choose all that apply?
nasty-shy [4]
Bitlocker Encryption can be used during the process of authenticating your computer with a TPM, during the process of authenticating your account with a USB flash drive, and most of the authentication through text messages.
3 0
3 years ago
Addition substraction and multiplication are examples of the set of _____ provided by the int data type
tatyana61 [14]

Answer:

The statement is true

Explanation:

8 0
1 year ago
______ is the ability of a system to do more than one thing at a time. A. Multibusing c. online processing b. Multiprocessing d.
mrs_skeptik [129]

Answer:

Multiprocessing.

Explanation:

In multiprocessing the system uses two or more processors to do more tasks simultaneously.

8 0
3 years ago
How to fix the Run Time ERROR 3706 provider cannot be found in ACCESS 2007?
stiks02 [169]
Hey,
Its a very rare error error in VB installation,
Try installing this:
<span>Jet 4.0 Service Pack 8 (SP8) for Windows XP (KB829558)
</span>I hope this will help.
7 0
3 years ago
Why were video games invented?
Alenkinab [10]
The answer is in the following website: https://www.reference.com/history/were-video-games-invented-e9413d3dc1378766


4 0
3 years ago
Other questions:
  • Describe how to manage the workspace by putting each feature under the action it helps carry out
    8·1 answer
  • Using underlining and italics at the same time is which of these? A. allowed but might be overkill B. always a good idea C. not
    15·2 answers
  • Why are specification for food processing tool,equipmentand untensils necessary?​
    8·1 answer
  • what is a massive online storage that allows for Access by any internet-connected device running web browser. use for Less priva
    6·1 answer
  • "Write a class named Car that has the following data attributes:" _ _year_model (for the car’s year model) _ _make (for the make
    12·1 answer
  • Which command allows d1 to configure an ip address on one of its physical interfaces?
    9·1 answer
  • What type of ransomware was developed to block the user from accessing the computer and encrypts all the files on the user's dev
    5·2 answers
  • Read the scenario and then answer the question using only the information provided.
    7·1 answer
  • A style sheet consists of CSS ______________________ that specify the layout and format properties to apply to an element. *
    13·1 answer
  • Please answer.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!