>>> from math import sqrt
>>> scope={}
>>> exec('sqrt=1',scope)
>>> sqrt(9)
3.0
>>> scope['sqrt']
1
>>>
python in<scope>实现
最新推荐文章于 2022-07-15 20:02:45 发布
>>> from math import sqrt
>>> scope={}
>>> exec('sqrt=1',scope)
>>> sqrt(9)
3.0
>>> scope['sqrt']
1
>>>