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
DedPeter [7]
2 years ago
12

Write a program that plays the popular scissor-rockpaper game. (A scissor can cut a paper, a rock can knock a scissor, and a pap

er can wrap a rock.) The program randomly generates a number 0, 1, or 2 representing scissor, rock, and paper. The program prompts the user to enter a number 0, 1, or 2 and displays a message indicating whether the user or the computer wins, loses, or draws. Here are sample runs:
scissor (0), rock (1), paper (2): 1
The computer is scissor. You are rock. You won
scissor (0), rock (1), paper (2): 2
The computer is paper. You are paper too. It is a draw
Computers and Technology
1 answer:
kolbaska11 [484]2 years ago
8 0

Answer:

import random

computer = random.randint(0, 2)

user = int(input("scissor (0), rock (1), paper (2): "))

if computer == 0:

   if user == 0:

       print("The computer is scissor. You are scissor too. It is a draw")

   elif user == 1:

       print("The computer is scissor. You are rock. You won")

   elif user == 2:

       print("The computer is scissor. You are paper. Computer won")

elif computer == 1:

   if user == 0:

       print("The computer is rock. You are scissor. Computer won")

   elif user == 1:

       print("The computer is rock. You are rock too. It is a draw")

   elif user == 2:

       print("The computer is rock. You are paper. You won")

elif computer == 2:

   if user == 0:

       print("The computer is paper. You are scissor. You won")

   elif user == 1:

       print("The computer is paper. You are rock. Computer won")

   elif user == 2:

       print("The computer is paper. You are paper too. It is a draw")

Explanation:

*The code is in Python.

Import the random to be able to generate number number

Generate a random number between 0 and 2 (inclusive) using randint() method and set it to the computer variable

Ask the user to enter a number and set it to the user variable

Check the value of computer the computer variable:

If it is 0, check the value of user variable. If user is 0, it is a draw. If user is 1, user wins. If user is 2, computer wins

If it is 1, check the value of user variable. If user is 0, computer wins. If user is 1, it is a draw. If user is 2, user wins

If it is 2, check the value of user variable. If user is 0, user wins. If user is 1, computer wins. If user is 2, it is a draw

You might be interested in
Meteoroids are small space rocks. They are usually pieces of asteroids or comets. Meteoroids orbit the sun like asteroids and co
Angelina_Jolie [31]
B is your answer meteoroids are small space rocks they are usually pieces of asteroids or comets
4 0
2 years ago
3. How can you correct the color of your photos automatically?​
natita [175]

Answer:

use the lightroom

download the app haha

4 0
3 years ago
Read 2 more answers
The element of website design that refers to the website's aesthetic appeal and the functional look and feel of the site's layou
zzz [600]

The element of website design that refers to the website's aesthetic appeal and the functional look and feel of the site's layout and visual design is known as context.

<h3>What is webpage context?</h3>

The web page context is known to be a kind of special ID that is is formed with all the new page load event.

The context of a website is known to be the point or place where a person can show their visitors that one care. It gives a kind of website's aesthetic appeal and the functional look.

Learn more about website design from

brainly.com/question/25941596

6 0
2 years ago
After discovering a security incident and removing the affected files, an administrator disabled an unneeded service that led to
patriot [66]

Answer:

A. Containment

Explanation:

  • This Containment is important before an incident or damage to resources. Most events require control, so it is important when handling each event. Containment provides time to develop a solution strategy that is prevalent.
  • Decisions Making decisions to facilitate an event is much easier if the decision is involved in predetermined strategies and processes. Organizations must define acceptable risks in dealing with events and develop strategies accordingly.
  • Network prevention is a fast and powerful tool designed to give security administrators the power they need to detect and prevent threats.
5 0
3 years ago
please write out an accurate code for the question below also please explain or I'll report you ( Thanks :) )
leva [86]

Answer: hmmmm i feel like u have to move the thingy thats shooting that light down 1 unit so it can move the planet.

Explanation: moving it down 1 unit will put it at the perfect angle to push the planet. :/

6 0
1 year ago
Read 2 more answers
Other questions:
  • What does iSCSI stand for?
    5·2 answers
  • What is the name of the nearest major galaxy to Milky-Way ?
    10·1 answer
  • Why is it important to explore an Integrated
    13·1 answer
  • Which of the following is the best example of market censorship
    11·2 answers
  • How do you activate the Formula AutoComplete function of Excel 2016?
    15·2 answers
  • A type of graph that uses horizontal bars to compare data is called a
    15·2 answers
  • !WILL MARK BRAINLIEST!
    8·1 answer
  • Which information can you apply to every page of your document with the page layout options?
    9·1 answer
  • Temperature converter. This program should prompt the user for two arguments, first a decimal number and second, a single letter
    10·1 answer
  • In which number system do the digital computer work​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!