今天写了一个简单的可以进行四则运算的计算器。
Hello = raw_input(‘Hello, welcome to cal’)
print Hello
a = input(‘Please enter the first number: ‘)
c = raw_input(‘please enter your function name: ‘)
b = input(‘Please neter the second number: ‘)
if c==’+’:
print ‘a+b =’, a+b
elif c==’-‘:
print ‘a-b =’, a-b
elif c==’*’:
print ‘a*b =’, a*b
elif c==’/’:
print ‘a/b =’, a/b