Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- first_num = int(input())
- second_num = int(input())
- operator = input()
- result = 0.0
- if operator == '+' or operator == '-' or operator == '*':
- if operator == '+':
- result = first_num + second_num
- elif operator == '-':
- result = first_num - second_num
- else:
- result = first_num * second_num
- even_ood = 'even' if result % 2 == 0 else 'odd'
- print(f'{first_num} {operator} {second_num} = {result} - {even_ood}')
- else:
- print(f'Cannot divide {first_num} by zero' if second_num == 0 else
- f'{first_num} {operator} {second_num} = {first_num % second_num}' if operator == "%"
- else f'{first_num} {operator} {second_num} = {first_num / second_num:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement