Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save olecksamdr/60daa6facd8acaa7ba5a143ff11aab64 to your computer and use it in GitHub Desktop.
Save olecksamdr/60daa6facd8acaa7ba5a143ff11aab64 to your computer and use it in GitHub Desktop.
Консольна гра "Камінь, Нижниці, Папір" на Python
import random
choises = ['Камінь', 'Ножниці', 'Папір']
print('0 - ', choises[0])
print('1 - ', choises[1])
print('2 - ', choises[2])
user = int(input('Виберіть цифру: '))
computer = random.randint(0, 3)
print('Ви вибрали: ', choises[n])
print('Компютер вибрав: ', choises[computer])
if user == 0 and computer == 1 or user == 1 and computer == 2 or user == 2 and computer == 0:
print('Ви виграли')
elif user == computer:
print('Нічия')
else:
print('Ви програли')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment