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
A(n) __________ window is an open window hidden from view but that can be displayed quickly by clicking the window's program but
Alex787 [66]
Minimized window

The sign to click is a "-" sign (minus)
4 0
3 years ago
I need help with these
solmaris [256]

Answer:

Choose internet is the right answer

7 0
2 years ago
Olivia works at a company that creates mobile phones. She wanted to estimate the mean amount of time their new phone's battery l
Kisachek [45]

An swer:  

                               

 E. xpl an ation:    

                               

3 0
2 years ago
MORE THAN ONE ANSWER!
borishaifa [10]

Answer:

YES to all the options given.

- Formatting rows and columns is similar to cell formatting.

- You can insert rows and columns into, or delete rows and columns from, a spreadsheet.

- You can hide or show rows and columns in a spreadsheet.

- You can adjust the height of rows and width of columns.

Explanation:

Formatting rows and columns is similar to cell formatting.

Yes, you can apply basically the same formats to columns and rows as you do with cells, like background, bold, text justification, number formats and much more.

You can insert rows and columns into, or delete rows and columns from, a spreadsheet.

Yes, you can easily add or delete rows and columns from a spreadsheet.

You can hide or show rows and columns in a spreadsheet.

Yes, that is common to hide rows or columns to mask some data, then to unhide them.

You can adjust the height of rows and width of columns.

Yes, absolutely, you can also specify to wrap text that is too long to fit in the width of the cells.

6 0
2 years ago
Read 2 more answers
An event or action that causes the task to start is called a
Vikentia [17]

Answer:

Trigger

Explanation:

The process through which an event or an action causes the task to start is called triggering. It is being extensively used in different subjects related to computer programming. And like we create a trigger in DBMS, to trigger some event like showing the output of some queries. And we do have the trigger used by various software as well, and which are built in various programming languages, and various platforms.

5 0
3 years ago
Other questions:
  • 12. In 2009, __________ of all pedestrian fatalities were caused by impaired drivers
    9·2 answers
  • The only way to print a photo is on a special glossy paper using professional printing services in a store
    9·2 answers
  • 19. The power supply in your server has just been replaced because of power problems. Your server boots, but now there is a mess
    13·1 answer
  • Where can we buy a cryptocurrency? from below options
    11·1 answer
  • NumA = 3 <br>numB = 2<br>Result = numA ** numB
    12·1 answer
  • I live in Pennsylvania which observes eastern standard time.
    13·1 answer
  • Why is operating system important software for computer?give 3 reasons
    8·1 answer
  • The higher the ____________________, the faster the ____________________.
    5·1 answer
  • A server is handling thousands of simultaneous connections, and proxying requests to another service. Which concurrency model is
    9·1 answer
  • Steps for Saving and opening a document.​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!