Код: Выделить всё
import random
Player_1 = input ("Choose Rock, Paper, or Scissors")
computer_choices = ["Rock", "Paper", "Scissors"]
computer_move = random.choice(computer_choices)
print(f"Computer chose: {computer_move}")
if Player_1 == computer_move:
print("Both players chose the same thing. The game is a draw!")
elif Player_1 == "Rock":
if computer_move == "Scissors":
print("Player with Rock wins!")
else:
print("Player with Paper wins!")
elif Player_1 == "Paper":
if computer_move == "Rock":
print("Player with paper wins!")
else:
print("Player with Scissors wins!")
elif Player_1 == "Scissors":
if computer_move == "Paper":
print("Player with scissors wins!")
else:
print("Player with Rock wins!")
play_again = "yes"
while play_again.lower() == "yes":
play_again = input("Do you want to play again? (yes/no): ")
Я пробовал изменить часть кода, например, поместить все это в цикл while, но не думаю, что это работает таким образом.
Подробнее здесь: https://stackoverflow.com/questions/790 ... ning-using