Files
labs/labPython/lab2/task3.py
2026-04-18 14:42:00 +05:00

15 lines
462 B
Python
Executable File

import random
while True:
comp = random.randint(1, 3)
user = int(input("1 - камень, 2 - ножницы, 3 - бумага: "))
if comp == user:
print("Ничья, попробуйте снова!")
continue
if (user == 1 and comp == 2) or (user == 2 and comp == 3) or (user == 3 and comp == 1):
print("Вы выиграли!", comp)
else:
print("Компьютер выиграл!", comp)
break