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
Nunya is a computer software company that employs highly intelligent, but somewhat unusual people. Every Friday, free lollipops,
mario62 [17]

Answer:

c. Stories

Explanation:

Informing employees about the founders by telling them at the beginning of each quarterly executive meeting, that the founders were three young people who got lucky and sold a video game that they invented is an example of stories technique for transmitting culture.

Cultural transmission is a learning process through which cultural elements, such as background ideas, attitudes, beliefs, ideals and historical values are passed on to individuals and groups.

3 0
3 years ago
What's the difference between an operating system and an application software?​
Serjik [45]

Answer:

An operating system is something that controls the functions of an application software(app). The app does specific tasks for the end-user; the end user is someone who is, or is supposed to, use a product. The app uses API to request services from the operating system. If the user is interacting direct with software, it is an application software.

Explanation:

6 0
2 years ago
Write a brief description of what the local authorities are recommending in the news people should do to protect themselves from
lana [24]
The brief description of the local author asbestos is Hope and that's what it would too with a heart and another heart which equals 100 which equals yes
3 0
3 years ago
How can you continue learning about computer science and improve your coding abilities?
Crank

Answer:

5 Ways to Improve Your Coding and Programming Skills

Take advantage of books and other free resources. ...

Sign up for a bootcamp. ...

Practice, practice, practice. ...

Engage with the computer science community. ...

Pursue a formal education in computer science.

7 0
3 years ago
Who wants to give free points to me?
Bad White [126]

Answer:

I can :) just comment lol

3 0
3 years ago
Read 2 more answers
Other questions:
  • Need Help !!! Please
    8·1 answer
  • Sarah is creating and formatting a newsletter for her school. Which page layout rules should she consider when doing this?
    13·2 answers
  • An is auditor reviewing a network log discovers that an employee ran elevated commands on his/her pc by invoking the task schedu
    10·1 answer
  • What is a mortgage?
    8·2 answers
  • Enter key is also known as Return key. (True or false)
    13·2 answers
  • Does coaxial cable use radio waves to transmit data
    10·2 answers
  • What are the possible consequences of intentional virus setting?
    14·1 answer
  • Directions and Analysis
    15·1 answer
  • Help pweeze this is due today :(<br><br> I will give u brainliest just pweeze, I need this answer :(
    8·1 answer
  • Type the correct answer in the box
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!