def main test ref test print test locals ref print test main

1
2
3
4
5
6
7
8
def main():
test = 1
ref='test'
print test
locals()[ref] = 2
print test
main()