(python)循环中动态产生变量 >>> for i in xrange(5): exec 'a'+str(i)+' = '+str(i)+'' >>> a0 0 >>> a1 1 >>> a2 2 这样就连续产生了5个命名有规律的变量a0,a1,a2,a3,a4