专题博客链接
[题解]浙大Python PTA课后习题博客记录(Python)
原题题目
代码实现
number1 = int(input());opersym = input();number2 = int(input())
if(number2 == 0):print("divided by zero")
elif(opersym == '*'):print("%.2f" %(eval("number1*number2")))
elif(opersym == "+"):print("%.2f" %(eval("number1+number2")))
elif(opersym == '/'):print("%.2f" %(eval("number1/number2")))
else:print("%.2f" %(eval("number1-number2")))