subject
Computers and Technology, 05.06.2020 18:03 1tzM3

How would I add a play again feature to this RPS program in python using a while loop? 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: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Aplan to budget time for studying and activities is referred to as a study routine. study habits. study skills. a study schedule.
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. andy received a potentially infected email that was advertising products. andy is at risk of which type of security threat? a. spoofing b. sniffing c. spamming d. phishing e. typo-squatting
Answers: 2
question
Computers and Technology, 23.06.2019 21:30
Which of the following includes the three primary network access technologies? dsl, cable modem, broadband lan, wan, man voip, uc, iptv tcp/ip, ftp, dhcp
Answers: 2
question
Computers and Technology, 24.06.2019 02:20
Peter is thinking of a number which isless than 50. the number has 9 factors.when he adds 4 to the number, itbecomes a multiple of 5. what is thenumber he is thinking of ?
Answers: 1
You know the right answer?
How would I add a play again feature to this RPS program in python using a while loop? import rando...
Questions
question
History, 20.07.2019 03:30
question
Social Studies, 20.07.2019 03:30
Questions on the website: 13722367