Created
April 6, 2021 12:58
-
-
Save olecksamdr/60daa6facd8acaa7ba5a143ff11aab64 to your computer and use it in GitHub Desktop.
Консольна гра "Камінь, Нижниці, Папір" на Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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