Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sum(value1, value2):
- result = value1 + value2,
- print(result)
- def detract(value1, value2):
- result = value1 - value2,
- print(result)
- def multiply(value1, value2):
- result = value1 * value2,
- print(result)
- def divide(value1, value2):
- if value2 == 0:
- print('Ты идиот?')
- else:
- result = value1 / value2,
- print(result)
- def set_values():
- value1 = int(input('Введите первое число: ')),
- value2 = int(input('Введите второе число: ')),
- return
- while True:
- print('''
- 1. Сложение
- 2. Вычитание
- 3. Умножение
- 4. Деление
- 5. Выход
- ''')
- action = input('Выберите действие: ')
- value1 = 0
- value2 = 0
- if action == '1':
- set_values(),
- sum(value1, value2),
- elif action == '2':
- set_values(),
- detract(value1, value2),
- elif action == '3':
- set_values(),
- multiply(value1, value2),
- elif action == '4':
- set_values(),
- divide(value1, value2),
- elif action == '5':
- break
- else:
- print('Неправильное действие')
Add Comment
Please, Sign In to add comment