Python Calculator
from whiteCalculator import Calculator
c = Calculator()
print(c.run("1+8(5^2)"))
# Output: 201
print(c.run("9Ans"))
# Output: 1809
Python Calculator
from whiteCalculator import Calculator
c = Calculator()
print(c.run("1+8(5^2)"))
# Output: 201
print(c.run("9Ans"))
# Output: 1809
how to make a calculator in python
#You can change Text at Inputs
num1 = float(input("Enter Firt Number:"))
num2 = float(input("Enter Second Number"))
result= 0
op = str(input("Enter an op(operator)"))
#Gets Input Type--------
try:
#U can make this in while loop ;-)
if op=="+":
result = num1 + num2
else if op=="-":
result = num1 - num2
else if op=="*":
result = num1 * num2
else if op=="/":
result = num1 / num2
else:
print("Invalid Input")
print("The result is " + result)
except ZeroDivisionError:
print("U cant do that")
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us