last lab
This commit is contained in:
15
labPython/lab2/task3.py
Executable file
15
labPython/lab2/task3.py
Executable file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user