我刚开始自学Python,我需要一些关于这个脚本的帮助:
old_string = "didnt work" new_string = "worked" def function(): exec("old_string = new_string") print(old_string) function()
我想得到它old_string = "worked".
old_string = "worked"
python string variables function exec
exec ×1
function ×1
python ×1
string ×1
variables ×1