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
compared to other data structures, this dbms structure is more flexible and stores data as well as instructions to manipulate th
Nuetrik [128]

Object-oriented databases is more flexible and stores data as well as instructions to manipulate the data.

A system known as an object database uses object-oriented programming to represent data in the form of objects. Different from relational databases, which are table-oriented, are object-oriented databases.

The concept of object-oriented programming languages, which is currently popular, is the foundation of the object-oriented data model. Overloading, polymorphism, and inheritance Object-oriented programming fundamentals that have found use in data modelling include object-identity, encapsulation, and information hiding with methods to provide an interface to objects. The rich type system, which includes collection and structured types, is supported by the object-oriented data model as well.

In contrast to relational databases, which can only handle one type of data, object databases can handle multiple data types. Unlike conventional databases like hierarchical, network, or relational, object-oriented databases can handle a variety of data types, including text, numbers, images, voice, and video.

Also, Reusable code, realistic modelling, and increased dependability and flexibility are all provided by object-oriented databases.

To learn more about Object-oriented databases click here:

brainly.com/question/29441658

#SPJ4

7 0
1 year ago
Which type of electronic community allows real time discussion among members
GrogVix [38]

Answer:

Instant messaging is the type of electronic community that allows real-time discussion among members.

7 0
3 years ago
Match the definition with the correct term: Closeness to the true value of a measurement
LenKa [72]
Closeness to the true value of a measurement is accuracy
7 0
3 years ago
What made the master so angry with his servant?​
sergeinik [125]

Answer:

what book?

Explanation:

6 0
2 years ago
Read 2 more answers
A software development team needs to upgrade a program, but the team members are having trouble understanding the program code a
labwork [276]

Hey there mate :)

As per question,

Question:- A software development team needs to upgrade a program, but the team members are having trouble understanding the program code and how it works. What could be the reason?

To find:- Write the correct option

Answer:- <u>Option </u><u>B.</u><u> </u><u>incomplete documentation</u>

Answer per sentence:-

A software development team needs to upgrade a program, but the team members are having trouble understanding the program code and how it works. This is due to <u>incomplete</u><u> </u><u>documentation.</u>

7 0
2 years ago
Other questions:
  • Your boss calls you from his home to use the vpn connection you configured for him on his laptop. he has traditionally depended
    6·1 answer
  • How does an employer judge a candidate?<br> The employer judge's the candidate's ? for a job.
    12·1 answer
  • What is the automotive name for the large wires that allow more electrical current to flow ?
    12·1 answer
  • When a user utilizes another computer to communicate with a third party, with the result that the third party cannot recognize t
    8·1 answer
  • Which part of a computer takes the text and pictures on your screen and prints them onto paper?
    6·1 answer
  • Which system utility can you use to troubleshoot a computer that's slow to start by enabling or disabling startup programs?
    7·2 answers
  • True or false when a host gets an IP address from a DHCP server it is said to be configured manually
    15·1 answer
  • Our Client, a renowned trading company, suffered a sudden, devastating power outage that caused their server to cease functionin
    13·1 answer
  • How do you mark answers brainliest?<br> it looks like they changed it and now idk how to
    12·1 answer
  • WILL GIVE BRAINLIEST!!! Danielle is warehouse supervisor for a large shipping company. Most shipments need to leave the warehous
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!