python eval的用法
2020-12-13 03:59
阅读:237
标签:htm isp splay span func eval code nbsp https python eval的用法 标签:htm isp splay span func eval code nbsp https 原文地址:https://www.cnblogs.com/sea-stream/p/11100367.html
>>>x = 7
>>> eval( ‘3 * x‘ )
21
>>> eval(‘pow(2,2)‘)
4
>>> eval(‘2 + 2‘)
4
>>> n=81
>>> eval("n + 4")
85
参考:
https://www.runoob.com/python/python-func-eval.html
评论
亲,登录后才可以留言!