Хей! Для \\"Камень, ножницы, бумага\\" достаточно использовать цикл for и словарь для хранения комбинаций. Например:
Программный код:
import random
choices = {'камень': 'ножницы', 'ножницы': 'бумага', 'бумага': 'камень'}
def get_winner(user, comp):
if user == comp:
return 'ничья'
elif choices[user] == comp:
return 'пользователь'
else:
return 'комп'
options = ['камень', 'ножницы', 'бумага']
while True:
user_choice = input('Ваш выбор: камень, ножницы, бумага? ').lower()
if user_choice not in options:
print('Повторите ввод')
continue
computer_choice = random.choice(options)
print(f'Комп выбрал: {computer_choice}')
winner = get_winner(user_choice, computer_choice)
if winner == 'ничья':
print('Ничья!')
elif winner == 'пользователь':
print('Вы выиграли!')
else:
print('Выиграл комп!')
play_again = input('Сыграем еще раз? (да/нет): ').lower()
if play_again != 'да':
break