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
Vlad1618 [11]
2 years ago
6

"write a program to play and score the paper-rock-scissor game. each of two users types in either p, r, or s. the program then a

nnounces the winner as well the basis for determining the winner: paper covers rock, rock breaks scissors, scissors cut paper, or nobody wins. be sure to allow the users to use lowercase as well uppercase letters. your program should include a loop that lets the user play again until the user says she or he is done."
Computers and Technology
1 answer:
algol132 years ago
8 0

The program is an illustration of conditional statements.

Conditional statements are used to execute instructions, if and only if certain <em>condition or conditions </em>are met.

Take for instance: <em>If b = 5, print "ab"</em>

The above print statement will only be executed, if the <em>value of b is 5</em>

The paper-rock-scissor program in Python where comments are used to explain each line is as follows,  

#This imports the random module

import random

#This is used to control the repetition of the game

playagain ="T"

#The following is repeated until the user chooses not to play again

while(playagain == "T"):

   #This generates a random choice for the computer

   computer = random.choice(['Rock', 'Paper', 'Scissors'])

   #This gets input for the player

   player = input('Choose: ')

   #If the player and computer choose the selection

   if player == computer:

       #Then, it's a tie

       print('A tie - Both players chose '+player)

   #If the player wins

   elif (player.lower() == "Rock".lower() and computer.lower() == "Scissors".lower()) or (player.lower() == "Paper".lower() and computer.lower() == "Rock".lower()) or (player == "Scissors" and computer.lower() == "Paper".lower()):

       #This prints "player won" and the reason

       print('Player won! '+player +' beats '+computer)

   #If otherwise,

   else:

       #This prints "computer won" and the reason

       print('Computer won! '+computer+' beats '+player)

   #This asks if the player wants to play again

   playagain = input("Play again? T/F: ")

At the end of each round,

  • The program displays the winner
  • Or prints a tie, if there's a tie

See attachment for sample run

Read more about conditional statements at:

brainly.com/question/22078945

You might be interested in
Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate
Alecsey [184]

Answer:p=float(input("Enter current bank balance:"))

i=float(input("Enter interest rate:"))

t=float(input("Enter the amount of time that passes:"))

print((p ((1+i)*t)))

Explanation:if this answer it looks weird its my phones fault

4 0
3 years ago
Read 2 more answers
In three to five sentences, describe how technology helps business professionals to be more efficient. Include examples of hardw
Natali5045456 [20]
Technology helps business professionals, keep more organized, communicate better, and effectively keeps businesses secure. Technology helps keep employee information and business paper<span> work more organized using</span>computers<span> and </span>software<span>; while making it easier to communicate with employee's using e-mail and memo's. With better alarm systems, camera's and online banking, security measures are endless. </span>
4 0
3 years ago
If your network subnet mask is /16, what is the maximum number of host ids available for this network?
kupik [55]
65534






-------------------------------------------
8 0
3 years ago
What did basic elements of music look like in the Twentieth Century period?
Alexandra [31]

Answer:

I just want my 5 point lol sorry hope you get your answer

Explanation:

get terraria

5 0
3 years ago
Select the correct statement(s) regarding partial mesh networks.
sweet [91]

Answer: all the answers are correct

Explanation:

Partial mesh networks is simply a packet switching networks which is connected and require that there should be establishment of a circuit before the exchange of packets.

Partial mesh networks are less expensive to implement when they're being compared to the full mesh networks and are also less redundant.

The correct statements regarding partial mesh networks are:

•the number of links connecting nodes in a partial mesh network depends upon the availability and reliability requirements of the network

• switches play an integral role in a partial mesh network, where several paths through the network are available

• redundant links and switches are used to improve the availability and reliability of partial mesh networks

6 0
3 years ago
Other questions:
  • Which files track internet usage and personal information when people visit websites?
    14·2 answers
  • What are the cause of eye strain during computer usage?
    7·1 answer
  • Which of the following is not true about designing classes? In order for class information to be printed instead of a memory add
    12·1 answer
  • Ben's team is working on an English project. The members want to see everyone's progress on their part of the project. What tech
    7·2 answers
  • In Java
    6·1 answer
  • Recently, your laptop won't power on, and the battery is not charging. You suspect the block on the power cord (also known as a
    5·1 answer
  • Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp
    11·1 answer
  • IN C++ PLEASE!!!! Define a function FilterStr() that takes a string parameter and returns "Good" if the character at index 4 in
    7·1 answer
  • If you need some one to talk to you can talk to me
    13·2 answers
  • A network device that is used to connect multiple devices together without segmenting a network is a __________.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!