eval()

s='12*2'
d=eval(s)#字符串运算函数
print(d)

结果:

24

posted @ 2022-03-07 18:37  长烟落日孤城闭  阅读(61)  评论(0)    收藏  举报