def whowin (first, second):
if first == 'ножницы' and second == 'камень':
print("second win")
elif first == 'камень' and second == 'бумага':
print('second win')
elif first == 'бумага' and second == 'ножницы':
print('second win')
elif first == 'ножницы' and second == 'бумага':
print('first win')
elif first == 'камень' and second == 'ножницы':
print('first win')
elif first == 'бумага' and second == 'камень':
print("first win")
def whowin (first, second):
result = (second - first) if abs(second - first) != 2 else -(second - first)
if result == 0:
print("ничья")
elif result > 0:
print('first win')
else:
print('second win')
def whowin (first, second):
result = (second - first) if abs(second - first) != 2 else -(second - first)
print("first win" if result > 0 else "second win")
def whowin(first, second):
game = {('ножницы', 'камень'): "second win",
('камень', 'бумага'): 'second win',
('бумага', 'ножницы'): 'second win',
('ножницы', 'бумага'): 'first win',
('камень', 'ножницы'): 'first win',
('бумага' 'камень'): 'first win'}
print(game[(first, second)])
def whowin (first, second):
if any([
all([first == 'ножницы',second == 'камень']),
all([first == 'камень',second == 'бумага']),
all([first == 'бумага',second == 'ножницы']),
]):
return ('second win')
elif any([
all([first == 'ножницы',second == 'бумага']),
all([first == 'камень',second == 'ножницы']),
all([first == 'бумага',second == 'камень']),
]):
return ('first win')
else:
return None