7-7 sdut-四则运算(用字典实现)---eval

知识点: 使用eval函数

a=input()
x=input()
b=input()
c=a+x+b
if(int(b)==0 and x=="/"):
    print("divided by zero")
else:
    print("{:.2f}".format(eval(c)))  ```
posted @ 2022-05-30 10:40  kingwzun  阅读(64)  评论(0编辑  收藏  举报