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 15:00
Which of the following statements tests if students have a grade of 70 or above, as well as fewer than five absences? a: if(grade > = 70 and daysabsent < = 5): b: if(grade > = 70 or daysabsent < = 5): c: if(grade > 70 and daysabsent < = 5): d: if(grade > 70 or daysabsent < = 5): i took the test the answer is a
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
What is the total number of time zones that can be configured to show by default in a calendar in outlook 2016?
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
George is working as a programming team lead. which statements correctly describe the skills that he requires?
Answers: 3
question
Computers and Technology, 24.06.2019 17:40
The value of sin(x) (in radians) can be approximated by the alternating infinite series create a function (prob3_2) that takes inputs of a scalar angle measure (in radians) and the number of approximation terms, n, and estimates sin(x). do not use the sin function in your solution. you may use the factorial function. though this can be done without a loop (more efficiently), your program must use (at least) one. you may find the mod() function useful in solving the problem.
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
Questions on the website: 13722367