2,i = i + 1 注意缩进要和if对齐才是在while内跳出循环的写法,注意此处缩进。
i = 0a = 0while i < 101:if i % 2 == 0: a = a + i i = i + 1print(a)