有没有办法在运行循环时用数字声明变量名字符串?我怎样才能做到这一点?例如给定n1, n2, n3...
,n1
必须存储i+l
值(n("string")
with i("number")
= n1)然后n2
必须存储i+l
迭代循环的值.....等
i=0
l=1
K=range(2,10)
for i in K:
print i
#how to declare a variable name by concatenating string and number
print '--------',l+i
#print n1,n2.....etc