Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = float(input())
- y = float(input())
- operation = input()
- if ((operation == '/' or
- operation == 'mod' or
- operation == 'div') and y == 0):
- print('Деление на 0!')
- else:
- if operation == '+':
- print(x + y)
- elif operation == '-':
- print(x - y)
- elif operation == '/':
- print(x / y)
- elif operation == '*':
- print(x * y)
- elif operation == 'mod':
- print(x % y)
- elif operation == 'pow':
- print(x ** y)
- elif operation == 'div':
- print(x // y)
- else:
- print('ввели что-то странное, я бы тут очень ругался')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement