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
Victor has been murdered, and Art, Bob, and Carl are suspects. Art says he did not do it. He says that Bob was the victim's frie
-BARSIC- [3]

Answer:

Bob

Explanation:

we can use symbolic reasoning to prove that Bob is not innocent without enumerating all of the cases.

6 0
3 years ago
Who was Naruto's first kiss<br><br>A. Hinata<br>B. Sasuke<br>C. Sakura​
Amanda [17]

His first kiss was Hinata and it was also her first kiss as well mark me as brainliest please

Your answer is A

3 0
3 years ago
Write the CSS for an id with the following attributes: i. float to the left of the page. ii. light tan background. iii. Verdana
miss Akunina [59]

Answer:

We create a block div with an id="block" and we make the css code

Explanation:

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>bloque</title>

<link href="bloque.css" rel="stylesheet" type="text/css">  

</head>

<body>

<!--we create the div with the id="block" and a text "hello world"-->

<div id="block"> hello world </div>

 

</body>

</html>

/* CSS Document */

/* we create the CSS file, then with the same id="block" we're programming in the CSS code*/

#block{

background-color: #ECDEC9;

padding: 20px;

float: left;

font-size: 50px;

font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans",     "DejaVu Sans", "Verdana", "sans-serif";

}

4 0
4 years ago
What skills and practices are important when creating an interactive program?
fenix001 [56]

The skills and practice that are important for creating an interactive program is brainstorming ideas, examination of similar programs and understanding of computer language.

<h3>What is an interactive program?</h3>

In computer, an interactive program refers to a type of computer software program that requires the user interaction to operate.

Some examples of the Interactive software includes word processors, spreadsheet applications, coreldraw etc

In conclusion, the skills and practice that are important for creating an interactive program is:

  • brainstorming of ideas
  • examination of similar programs
  • understanding of computer language.

Read more about interactive program

<em>brainly.in/question/4966741</em>

6 0
3 years ago
Gabriel's sister called him about a message that suddenly appeared on her screen that says her software license has expired and
BabaBlast [244]

Answer:

Blocking ransomware

Explanation:

A ransomware is a malware that acts by encrypting the files of a victim after which the attacker demands for a ransom payment to be made by the victim before access is restored through the provision of a key to decrypt the encrypted files

There are different types of ransomware such as blockers, wipers and cryptors

A blocker ransomware is one that blocks access to the files stored on a computer or device by encrypting them and usually displaying a demand for payment message that comes up in front of the all opened windows

5 0
3 years ago
Other questions:
  • What is the name of small programs stored on the hard drive that tell the computer how to communicate with a specific hardware d
    5·1 answer
  • A(n _______________ is a pre-written formula that is built into excel
    12·1 answer
  • Readability is the level of vocabulary used on the page. True or false
    8·1 answer
  • The operation:
    8·1 answer
  • Two stations running TCP/IP are engaged in transferring a file. This file is 1000MB long, the payload size is 100 bytes, and the
    14·1 answer
  • What was the first stored prograam electronic digital computer
    11·2 answers
  • The Presonus Studio Live 24 console has analog D-sub direct outputs. What cable would you need to connect this to a HD Analog in
    15·2 answers
  • Can someone translate this? (it's morse code btw)
    5·2 answers
  • How do the interests of carriers differ from the interests of websites? What are the implications for websites from a value chai
    8·1 answer
  • You are looking for a computer to provide a central location for online game play. What kind of computer do you need
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!