How can predifined code be called with exec()?

前端 未结 0 1297
-上瘾入骨i
-上瘾入骨i 2021-02-14 16:37

Is it possible to call predefined code using exec()?

In[0]
exec(f"var{1} = 55")
print(var1)
print(exec(f"var{1}"))

Out[0]
55
Non         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题