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]
2 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]2 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
Should i change my profile pic<br> dont delete
nignag [31]
On the one hand it looks pretty cool, on the other hand change is good
8 0
3 years ago
Read 2 more answers
How many instructions can the microprocessor execute each second if the assembly line is present?
SpyIntel [72]

The instructions that he microprocessor can execute each second if the assembly line is present will be depending on the workload and the architecture’s core because it is all depending on the speed of the CPU and the multiplier that it acquires.

3 0
3 years ago
Aaron bought a photo-editing software package for personal use. He makes two copies of the software, in case the original softwa
Korvikt [17]

Aaron's action is considered legal, as you are allowed to make a backup copy of a legal copy of a software, but it can only be used in case the original software is destroyed or unusable.

5 0
3 years ago
Content from online educational tools that is not protected under FERPA includes:
Dmitry [639]

Answer:

b. Any metadata that an online tool produces (for example, data about a student’s usage of a tool, or how much time it took them to take an assessment or look at a video) is not protected if it is not tied to any identifying information.

Explanation:

The content form educational tools that are online that is not protected under FERPA(Family Education Rights and Privacy Act) is any metadata that is produced by the online tool.That metadata can contain data about student's usage of a tool etc.

FERPA governs the access educational information and records by public entities.

4 0
3 years ago
I need help. People who know computer science. I have selected a word from the first 1000 words in my dictionary. Using the bina
Rudiy27

Answer:

14

Explanation:

8 0
2 years ago
Other questions:
  • Computer hardware had been designed to run a single operating system and a single app, leaving computers vastly underutilized. o
    15·1 answer
  • PLEASE ANSWER THIS IM IN A QUIZ
    15·2 answers
  • WILL GIVE BRAINLIEST
    15·1 answer
  • HELP
    11·1 answer
  • Describe the impact of improvement ls in technology and transportation on american citizens. ​
    7·1 answer
  • If Anime Characters were real , Who Would Your Anime Wife Would Be (Tell Who And Why)
    10·1 answer
  • Sustainable development is a goal towards which all human societies need to be moving. elaborate the statement in about 120 word
    9·1 answer
  • The act of getting information out of memory storage
    6·1 answer
  • How Powerpoint is useful in education aspect?
    5·2 answers
  • What is the total number of time zones that can be configured to show by default in a calendar in Outlook 2016?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!