subject
Computers and Technology, 08.06.2020 19:57 Geo777

How would I add a play again function to this code in python? import random
choice = input("Enter Rock(R), Paper(P), or Scissors(S): ")
computer = random. randint(1, 3)
if computer == 1:
print("Computer played R.")
elif computer == 2:
print("Computer played P.")
else:
print("Computer played S.")
#Winning conditions
if computer == 1 and choice == "R":
print("Computer played Rock.")
print("Tie")
elif computer == 2 and choice == "P":
print("Computer played Paper.")
print("Tie")
elif computer == 3 and choice == "S":
print("Computer played Scissors.")
print("Tie")
elif computer == 1 and choice == "S":
print("Computer played Rock.")
print("You Lose")
elif computer == 2 and choice == "R":
print("Computer played Paper.")
print("You Lose")
elif computer == 3 and choice == "P":
print("Computer played Scissors.")
print("You Lose")
elif computer == 1 and choice == "P":
print("Computer played Rock.")
print("You Win")
elif computer == 2 and choice == "S":
print("Computer played Paper.")
print("You Win")
elif computer == 3 and choice == "R":
print("Computer played Scissor.")
print("You Win")

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
Hi plz 11 ! when planning a table, what step comes first: "define the column headers" or "calculate the number of columns/rows"? a. calculate the number of columns/rows b. define the column headers
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
question
Computers and Technology, 23.06.2019 06:40
What are the three uses of a screw?
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
Need ! will choose brainliest! discuss the role of abstraction in the history of computer software.
Answers: 1
You know the right answer?
How would I add a play again function to this code in python? import random
choice = input("E...
Questions
question
Mathematics, 28.04.2021 21:30
question
Mathematics, 28.04.2021 21:30
question
Mathematics, 28.04.2021 21:30
question
Mathematics, 28.04.2021 21:30
question
Mathematics, 28.04.2021 21:30
Questions on the website: 13722361