num_one =int(input("Enter 1st number: "))
op =input("Enter operator: ")
num_two =int(input("Enter 2nd number: "))
if op =="+":
print(num_one + num_two)
elif op =="-":
print(num_one - num_two)
elif op =="*"or op =="x":
print(num_one * num_two)
elif op =="/":
print(num_one / num_two)
Posted by: Guest
on August-01-2020
0
python calculator
# simple calculatortry:
# prompt user
num1 =float(input("Please Enter The first number: "))
operator =input("Please choose the operator (+) for addition, (-) for subtraction, (*) for multiplication""(/) for division , (%) for remainder: ")
num2 =float(input("Please Enter The second number: "))
if operator =='+':
result = num1 + num2
print("The result is: ", result)
elif operator =='-':
result = num1 - num2
print("The result is: ", result)
elif operator =='*':
result = num1 * num2
print("The result is: ", result)
elif operator =='/':
try:
ifTrue:
result = num1 / num2
print(result)
except ZeroDivisionError as err:
print(err, " oops! zero division occur ")
elif operator =='%':
if operator =='%':
result = num1 % num2
print("The result is: ", result)
else:
raise TypeError
except ValueError:
print("wrong value, suggest integer or decimal")
finally:
print("All Done")
Posted by: Guest
on September-23-2020
Code answers related to "write a program in python to display artimatic calculator"
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
Check Your Email and Click on the link sent to your email