Skip to content

Instantly share code, notes, and snippets.

@gorn
Created October 5, 2018 12:09
Show Gist options
  • Save gorn/350bd179324ce35d4bac2e778e2816e9 to your computer and use it in GitHub Desktop.
Save gorn/350bd179324ce35d4bac2e778e2816e9 to your computer and use it in GitHub Desktop.
Twitter Kámen Nůžky Papír
#Muj pokus
from random import choice
p={'K':'P', 'N':'K', 'P':'N'}
h=['K', 'N', 'P']
while True:
a=input('\nK/N/P?: ')
if a in h:
b = choice(h)
print(b,'-> ',end= ' ')
if p[b] == a:print('vyhrals')
elif p[a] == b:print('prohra')
else: print('remis')
else: print('neplatne', a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment