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"