How would I add a play again function to this code in python?
import random
choice = input("E...
![subject](/tpl/images/cats/informatica.png)
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](/tpl/images/cats/User.png)
Answers: 3
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 15:00
Which of the following has not been attributed at least in part to social media a. drug addiction b. depression c. kidnapping d. murder
Answers: 2
![question](/tpl/images/cats/informatica.png)
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 20:30
1. for which of the following are you not required to signal beforehand? a. changing lanes b. speeding up c. stopping
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 10:00
Which feature of a blog to restore and retrieve older post
Answers: 3
You know the right answer?
Questions
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 04.03.2021 23:20
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 04.03.2021 23:20
![question](/tpl/images/cats/en.png)
English, 04.03.2021 23:20
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 04.03.2021 23:20
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
English, 04.03.2021 23:20
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 04.03.2021 23:20
![question](/tpl/images/cats/istoriya.png)
History, 04.03.2021 23:20
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 04.03.2021 23:20
![question](/tpl/images/cats/mat.png)
Mathematics, 04.03.2021 23:20
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
History, 04.03.2021 23:20
![question](/tpl/images/cats/en.png)
English, 04.03.2021 23:20
![question](/tpl/images/cats/mat.png)
Mathematics, 04.03.2021 23:20