#Standard Calculator
operator = input('Which operation do you wanna perform? \n +, -, * or /: ')
a = float(input('enter the number here:'))
b = float(input('enter the number here:'))
if operator == '+':
print(a, operator, b, '=', a+b)
elif operator == '-':
print(a, operator, b, '=', a-b)
elif operator == '*':
print(a, operator, b, '=', a*b)
elif operator == '/':
print(a, operator, b, '=', a/b)
else:
print('Invalid operation!')
#Output:
For Addition:
Which operation do you wanna perform?
+, -, * or /: +
enter the number here:33
enter the number here:2.036
33.0 + 2.036 = 35.036
For Subtraction:
Which operation do you wanna perform?
+, -, * or /: -
enter the number here:23
enter the number here:65656
23.0 - 65656.0 = -65633.0
For Multiplication:
Which operation do you wanna perform?
+, -, * or /: *
enter the number here:1.009
enter the number here:23187
1.009 * 23187.0 = 23395.682999999997
For Division:
Which operation do you wanna perform?
+, -, * or /: /
enter the number here:23456
enter the number here:2984
23456.0 / 2984.0 = 7.86058981233244
For Arithmetic Operators visit link: click here
Comments
Post a Comment