当a为6时,循环体末端的i值是多少?
def loopIdentification():
i=0
for a in range(2,8):
i=i+a-3
return i
答案 0 :(得分:1)
<强> 5 强>
>>> def loopIdentification():
i=0
for a in range(2,8):
i=i+a-3
print a, i
return i
>>> loopIdentification()
2 -1
3 -1
4 0
5 2
6 5
7 9
9