我刚刚在python中编写了一个简单的计算器脚本,通常python默认应该识别(-)减号,(*)乘法,(/)除号,但是在考虑这个脚本时它无法识别符号。请留下您的评论以清除我...
#! /usr/bin/python
print("1: ADDITION")
print("2: SUBTRACTION")
print("3: MULTIPLICATION")
print("4: DIVISION")
CHOICE = raw_input("Enter the Numbers:")
if CHOICE == "1":
a = raw_input("Enter the value of a:")
b = raw_input("Enter the value of b:")
c = a + b
print c
elif CHOICE == "2":
a = raw_input("Enter the value of a:")
b = raw_input("Enter the value of b:")
c = a - b
print c
elif CHOICE == "3":
a = raw_input("Enter the value of a:")
b = raw_input("Enter the value of b:")
c = a * b
print c
elif CHOICE == "4":
a = raw_input("Enter the value of a:")
b = raw_input("Enter the value of b:")
c = a / b
print c
else:
print "Invalid Number"
print "\n"