Skip to main content

Posts

Showing posts with the label calculator

Simple Calculator using Python

# 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 *