如果
x = Apple
y = 0123
如何使用x& amp;创建新变量Apple0123? Y'
基本上如此:COMBINE(x,y)= 5
如果我输入Apple0123 - >输出为5
答案 0 :(得分:0)
x = 'Apple'
y = '0123'
x+y
exec("%s = %d" % ((x+y),5))
print(Apple0123)
或
x = 'Apple'
y = '0123'
x+y
vars()[x+y]
print(Apple0123)