>>>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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
猜你喜欢
  • 2021-07-24
  • 2022-03-07
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2022-02-02
  • 2021-10-12
相关资源
相似解决方案