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 does the presence of the cydia app on an ios device indicate?
Natasha2012 [34]
Had to look for the options and here is my answer. 
Cydia app is an app that is common found on those devices that are jailbroken because this provides third-party custom apps. Therefore, the presence of Cydia app on an iOS device would indicate that the device has been jailbroken. Hope this helps.
6 0
3 years ago
A ________ is a material deficiency, or combination of significant deficiencies, that results in more than a remote likelihood t
VLD [36.1K]

Answer:

a.material control failure

Explanation:

A material control failure is a material deficiency, or combination of significant deficiencies, that results in more than a remote likelihood that a material mis-statement in the annual or interim financial statements will not be prevented or detected.

7 0
3 years ago
If you know the unit prices of two different brands of an item you are better able to
vitfil [10]

Answer:

TO UNDERSTAND TO ITS VALUES AND ITS  FEATURES

Explanation:

4 0
3 years ago
What happens if part of an ftp message is not delivered to the destination?
Oliga [24]

The message is lost when an FTP message is not delivered to its destination because FTP doesn't use a reliable delivery method.

<h3>What is FTP?</h3>

FTP is an abbreviation for file transfer protocol and it can be defined as a type of server that's designed and developed to store and provide files for download, as well as sharing between two or more users on an active computer network.

Generally, the message is lost when an FTP message is not delivered to its destination because FTP doesn't use a reliable delivery method.

Read more on FTP here: brainly.com/question/20602197

#SPJ12

4 0
2 years ago
An air-conditioning system's automatic controller might directly control the
yaroslaw [1]
Control the temperature of the system and as well as how long the system will run
5 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose an instruction takes 4 cycles to execute in an unpipelined CPU: one cycle to fetch the instruction, one cycle to decode
    10·1 answer
  • Write a program that will generate 100 integers between 0 and 1000. Store the even numbers in a sorted linked list called evens.
    12·1 answer
  • Which behavior of the application should the user expect? A user profile has login hour restrictions set to Monday through Frida
    12·1 answer
  • Help me pls, thank you
    12·2 answers
  • Which statement best describes desktop publishing?
    10·1 answer
  • Can someone please help me with 6.8 Code Practice adhesive.
    14·2 answers
  • Send me the answers<br>​
    15·1 answer
  • Describe, with examples, the way in which a defect in software can cause harm to a person, to the environment, or to a company
    9·1 answer
  • NEED HELP QUICK!!!
    12·1 answer
  • Imagine that you need to prepare for three end-of-term tests. What steps will you take to make sure your study time is well spen
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!