怎么这样也可以的?
# -*- coding:utf-8 -*- L1 = [] x = 0 for x in range(0, 101): L1.append(x * x) x += 1 print sum(L1)
# -*- coding:utf-8 -*- L1 = [] x = 0 for i in range(0, 101): L1.append(x * x) x += 1 print sum(L1)
上下两段,一个是for x一个是for i,怎么输出的答案都一样啊??
# -*- coding:utf-8 -*- L1 = [] x = 0 for x in range(0, 101): L1.append(x * x) x += 1 print sum(L1)
# -*- coding:utf-8 -*- L1 = [] x = 0 for i in range(0, 101): L1.append(x * x) x += 1 print sum(L1)
上下两段,一个是for x一个是for i,怎么输出的答案都一样啊??
2017-08-18
举报