PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#MADE BY ZAHED SHAIKH
''' Instructions to use=> Enter the first number, then a space and the operation (+, -, *, /, //, %, **) and a space then at last enter the second value. example ==> 34 * 34 '''
raw_input = input()
values = raw_input.split()
if len(values) != 3:
print(f'Are you sure you followed the instructions carefully?\nYour input: {raw_input}\nMake sure to put spaces')
else:
f, o, s = int(values[0]), values[1], int(values[2])
def calculate(x, y, z):
ops = {'+': x + z, '**': x ** z, '-': x - z, '*': x * z, '/': x / z, '//': x // z, '%': x % z}
print(f'Your input: {raw_input}\n{ops.get(y, f"Invalid input {y}")} is the answer')
calculate(f, o, s)
print("↓\n↓\n#MADE BY ZAHED SHAIKH")
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run