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 statement is FALSE? If a method does not return a value, the return-value-type in the method declaration can be omitted. P
Tcecarenko [31]

Answer:

If a method does not return a value, the return-value-type in the method declaration can be omitted.

Explanation:

If a method does not return a value, the return-value-type in the method declaration can be omitted is a false statement.

8 0
3 years ago
To adapt to dimmer light with a film camera would be more complicated than with a digital
Zinaida [17]

Answer:

Changing the _exposure_ to adapt to dimmer light with a film camera would be more complicated than with a digital camera.

Explanation:

Film Camera is heavier, and it can cost a lot if we want to adapt to dimmer light and shoot in that dimmer light. Digital cameras are cheaper. In the case of a Film Camera, you need to lower down the shutter speed, make adjustments related to the aperture, ensure that the camera does not shake a lot, make use of the faster lens, as well as adjust the while balances, and use certain different light source. And all this confirms that it is not that easy to do this with Film cameras, and they can cost a lot as well. Digital Cameras are cheaper, and a better option for you. And you need to change the exposure to adapt to less light with the film Camera, but this is much easier with the digital camera. You will soon find out if you use them.

5 0
3 years ago
Alcohol first impairs your ________.
lesya [120]
Judgment because Alcohol is a depressant. Hope this helps
6 0
3 years ago
Read 2 more answers
Datta Computer Systems is considering a project that has the following cash flow data. What is the project's IRR? Note that a pr
Afina-wow [57]

Answer:

IRR is 20.64%

Explanation:

The internal rate of return is the rate of return on the project where the present of values of the  cash inflows over the three years equals the cash outflow in year zero.

It is simply a breakeven rate of return on investment project.

Using a spreadsheet approach,the formula for IRR is given below:

=IRR(values)

the values are the cash inflows and outflow in the relevant years.

IRR=20.64% as in the attached file

This shows that none of the five options is correct

Download xlsx
4 0
3 years ago
Which term describes the degree to which a network can continue to function despite one or more of its processes or components b
liubo4ka [24]

Answer:

the answer is fault tolerance

Explanation:

4 0
3 years ago
Other questions:
  • What is the difference, if any, between a Portable Media Player (PMP) and a Digital Media Device (DMD)? PMPs can be analog or di
    12·1 answer
  • In Microsoft Word you can access the _______ command from the "Mini toolbar".
    9·1 answer
  • Which type of drawer has three dispensing modes: single-dose, multi-dose, and matrix?
    13·1 answer
  • Which one of the following statements is true regarding the fetch-execute cycle? Each step of the fetch-execute cycle is perform
    15·1 answer
  • Who will help me with a test on Computer Science plz will help you level up and upvotes!!!!! plzzzzzzzzzzzzzzzzzzz
    13·2 answers
  • Write a program, called compute_stats.c, which opens a data file, called numbers.txt, which contains of a list of positive integ
    10·1 answer
  • Select three advantages of cloud computing.
    10·1 answer
  • What is digital marketing?
    5·1 answer
  • Raul is a 13-year-old teenager interested in taking up photography as a new hobby. His dad wants to buy him a camera for his bir
    13·1 answer
  • Draw a flowchart that solve the problem of calculating the average of 5 numbers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!