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 you use the tilde operator (~ in a url for the attribute of a server control, it represents the _____ directory of the webs
Verizon [17]
The tilde operator represents the root directory of the website.
4 0
3 years ago
Write a program that allows the user to play a guessing game. The game will choose a "secret number", a positive integer less th
Burka [1]

Answer:

// This program is written in C++

// Comments are used for explanatory purpose

// Program starts here

#include<iostream.h>

#include<stdlib.h>

int main()

{

// Declare variables

int num, selectno;

string status;

randomize();

//Generate random number;

num=rand()%10000;

// Prompt to guess a number

cout<<"You have only 10 tries\nTake a guess: ";

int tries = 0;

while (tries != 10)

{

cin>>selectno;

if(selectno == num){

cout<<"You passed at the "<<count+1<<" attempt";

tries = 10;

}

else

{

cout<<"You failed. Take another guess\n You have "<<10 - count + 1 <<" attempts";

}

tries++;

if(tries >= 10)

{

break;

}

}

return 0;

}

8 0
2 years ago
An excel file called “student_gpa” is opened. What does the funnel next to “GPA” indicate
Ivan

Answer is A. The data has been filtered

The funnel in Excel lets you know that there is a filter in place on the columns. It is a filter icon. By default, any filtered column in Excel gets a little funnel icon on the top row as shown in the image attached. Once this funnel symbols is clicked, it gives you options to filter using several criteria.

6 0
3 years ago
A network system administrator would typically be responsible for which of the following duties?
EleoNora [17]

Answer:

A) Maintaining the shared connections between offices

Explanation:

Plz mark brainliest

3 0
3 years ago
Read 2 more answers
Rosa is a high school freshman with no savings. She wants to buy a new smartphone in a few months for $300. Which account type b
Iteru [2.4K]
Simple savings account
6 0
2 years ago
Read 2 more answers
Other questions:
  • ______________ is only one of the marketing mix tools that acompany uses to achieve its marketing objectives.
    7·1 answer
  • What is a good way to minimize technical problems with your computer
    10·1 answer
  • Describe how one can change row and height
    6·1 answer
  • my airpods just do not seem to connect if i try to pair them, reset them, they have this continuous green light, please help me
    12·1 answer
  • Digital printing is not suitable for printing what
    11·1 answer
  • What is human data,
    8·1 answer
  • (Reverse number) Write a program that prompts the user to enter a four-digit inte- ger and displays the number in reverse order.
    9·1 answer
  • What is a field on a table
    13·1 answer
  • How would you write this using Java: Use a TextField's setText method to set value 0 or 1 as a string?
    5·1 answer
  • Data security issues that must be addressed by hipaa implementation teams include:__________
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!