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
Examine the following output:
bixtya [17]

The report shows that SERVER1 has six active TCP connections. The first two are in the state TIME WAIT, the third is in the state CLOSE WAIT, and the final three are in the state ESTABLISHED.

TCP: What is it?

One of the key protocols in the Transmission control protocol / internet family is the Transmission Control Protocol. (TCP). It was first used to supplement the Internet Protocol in network protocol deployments (IP). TCP/IP is the name given to the full suite as a result. Software running on hosts communicating via an IP network can transmit a stream of octets (bytes) in a reliable, orderly, and error-checked manner using TCP. TCP is a key component of popular internet services like the World Wide Web mail, remote management, and file transfer.

To know more about TCP
brainly.com/question/28119964
#SPJ4

8 0
1 year ago
Which form of investigation aims at checking whether or not a target system is subject to attack based on a database of tests, s
VikaD [51]

Answer:

<em>Empirical technical </em>research has a fundamental objective, which is to provide objective and independent information on the quality of the product to the interested party or stakeholder. It is one more activity in the quality control process.

Explanation:

Testing is basically a set of activities within software development. Depending on the type of tests, these activities may be implemented at any time during said development process. There are different software development models, as well as test models. Each one has a different level of involvement in development activities.

In a full penetration testing process, there are pre-instances to run this tool, but to take the first steps it is probably the best way to start. Nmap is a network scanning tool that allows you to identify what services are running on a remote device, as well as the identification of active computers, operating systems on the remote computer, existence of filters or firewalls, among others.

In simple words, when a server or device is going to be attacked, the attacker can carry out different attacks depending on the service: it is not the same to damage a web server, a database server or a perimeter router. Therefore, in any deployment, the first step will be to identify the services in the infrastructure, to decide how to proceed and, considering that in a penetration test the steps of an attacker are “imitated”, it will also be started in the same way.

5 0
3 years ago
Which of these are examples of a Single Sign-On (SSO) service?
12345 [234]
Kerberos and OpenID are SSO Services.
5 0
3 years ago
python Write a program that will take a file named Celsius.dat that contains a list of temperatures in Celsius (one per line), a
jekas [21]

with open('celcius.dat', 'r') as fIn, open('fahrenheit.dat', 'w') as fOut:

   for line in fIn:

       fahrenheit = 9.0 / 5.0 * float(line) + 32

       fOut.write("%.1f\n" % fahrenheit)


You can control the number of decimals in the formatting clause in the write statement.

6 0
3 years ago
Name the three basic storage device of a computer​
grigory [225]
Hard disk Drive, random access memory, USB flash memory
7 0
3 years ago
Read 2 more answers
Other questions:
  • A ___________ is an algorithm for which it is computationally infeasible to find either (a) a data object that maps to a pre-spe
    5·1 answer
  • Chloe is building a kiosk-based Excel application. She wants to make some modifications to the screen elements in order to keep
    8·1 answer
  • What role do you think mobile devices have played in shaping the world?
    13·1 answer
  • Where could an identity thief access your personal information?
    13·1 answer
  • Which of the following languages does not provide built-in-pattern matching operations (the language, although, has pattern matc
    14·1 answer
  • Which operating system (OS) is used to run your laptop?
    15·2 answers
  • In one to two sentences, describe how you would add a new slide to your presentation.
    11·2 answers
  • Please tell fast plzzzzzz​
    5·2 answers
  • Employers are looking for an employee?<br>​
    9·1 answer
  • Write the implementation of a class Cse20 Topic that represents a topic in the cse20 class. The class should implement the init
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!