下面两段Python代码都是用于求1-10的和,其运行结果相同。通常说来,for-in循环都可以用while循环实
现。( )
tnt = 0for i in range(1,10 + 1): tnt += iprint(tnt)tnt = 0i = 1while i <= 10: tnt += i i += 1print(tnt)下面两段Python代码都是用于求1-10的和,其运行结果相同。通常说来,for-in循环都可以用while循环实
现。( )
tnt = 0for i in range(1,10 + 1): tnt += iprint(tnt)tnt = 0i = 1while i <= 10: tnt += i i += 1print(tnt)