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
vichka [17]
3 years ago
8

Write a Python 3 script in PyCharm that will simulate the game of "Rock, Paper, Scissors": Display a header and the simple rules

of RPS Prompt player_1 for their move To make sure player_2 can't see what player_1's move was, insert: print('*** NO CHEATING ***\n\n' * 20) Prompt player_2 for their move Design and develop an IF-ELSE structure to play the game IF player_1's move equivalent to player_2's move, "It's a tie" "rock" beats "scissors" "scissors" beats "paper" "paper" beats "rock" Make sure you test for valid input!!
Computers and Technology
1 answer:
mr Goodwill [35]3 years ago
7 0

Answer:

'''

Rock, Paper, Scissors:

The Rules:

If player1's move equivalent to player2's move, "It's a tie".

"rock" beats "scissors", "scissors" beats "paper", and "paper" beats "rock"

'''

player_1 = input("Player 1's move: ")

print('*** NO CHEATING ***' * 20)

player_2 = input("Player 2's move: ")

if player_1 or player_2 not in ["rock", "paper", "scissors"]:

 print("Invalid input!")

if player_1 == player_2:

   print("It's a tie")

else:

   if player_1 == "rock":

       if player_2 == "scissors":

           print("Player 1 won")

       elif player_2 == "paper":

           print("Player 2 won")

   elif player_1 == "scissors":

       if player_2 == "paper":

           print("Player 1 won")

       elif player_2 == "rock":

           print("Player 2 won")

   elif player_1 == "paper":

       if player_2 == "rock":

           print("Player 1 won")

       elif player_2 == "scissors":

           print("Player 2 won")

Explanation:

In the comment part, put the header and the rules of the game

Ask the user to enter the player1's move

Print the asterisks

Ask the user to enter the player2's move

If any of the input is not "rock", "paper", "scissors", state that the input is invalid

Check the inputs. If they are equal, print that it is a tie. Otherwise:

If player1's move is rock. Check player2's move. If it is "scissors", player1 wins. If it is "paper", player2 wins

If player1's move is scissors. Check player2's move. If it is "paper", player1 wins. If it is "rock", player2 wins

If player1's move is paper. Check player2's move. If it is "rock", player1 wins. If it is "scissors", player2 wins

You might be interested in
When a crash results in property damages of any amount, the driver must notify:
elena55 [62]

Answer:

A. Their Insurance Agency to report the incident and the cost amount for repairing what they damaged.

Explanation:

Well it's considered an accident, so I would assume straight away, you report it to your insurance agency. If it's you that caused the damages to the property, you have a certain tax dollar amount you pay every month for your car insurance, which pays for the damaging of your car, and the damages you caused on someones property with that very vehicle, so A. Their Insurance Agency.

Hope this helped, mate.

7 0
4 years ago
The statement x++;
natita [175]

Answer:

The correct option for the given question is option(A) i.e Increments the value currently stored in the variable x and stores that new value back in the variable x.

Explanation:

x++ is an  increment operator Their are two types of increment operator

1.Post increment

2.Pre increment.

Post increment operator assign the value first to variable then increment the value by 1.

for example

int a=7,t;

t=a++; //post increment

Pre increment operator first  increment the value by 1 then store into variable.

int  a=7,t;

t=++a; // Pre increment.

So the correct answer is option(a)

8 0
3 years ago
True or False
OverLord2011 [107]

Answer:False

Explanation:

7 0
3 years ago
Arrange these steps of creating a presentation in the correct order.
koban [17]

1. Click Create Presentation

2. Background

3. Wizard

4. Animation

7 0
4 years ago
Read 2 more answers
Every brand of computer has its own binary language, called
Kaylis [27]
Machine language.

Hope this helps
6 0
3 years ago
Other questions:
  • You created a database related to medicinal plants and their uses. For every plant, you would like to enter a description about
    11·1 answer
  • If r is an instance of the above Person class and oddNum has been declared as a variable of type boolean, which of the following
    8·1 answer
  • Which solution eliminates the need for dedicated high-speed WAN connections between sites
    11·1 answer
  • Which of the following is a device that plugs in a usb port on the computer or mobile device and contains multiple usb ports?
    9·1 answer
  • Wi-fi works by converting data signals into which of the following?
    8·2 answers
  • Write an expression that prints 'You must be rich!' if the variables young and famous are both True. Sample output with inputs:
    9·1 answer
  • You want to receive alerts if unusual activity is detected relating to the Web servers deployed in your perimeter network. What
    7·1 answer
  • Long Answer Questions: a. Briefly explain the types of Control Structures in QBASIC.​
    5·1 answer
  • Which line of code will cause the loop to execute exactly one time?
    13·1 answer
  • Let A and B be regular languages. Is the set of strings of odd length from A beginning with 0 concatenated with the set of strin
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!