continue我要怎么去记忆啊
num = 0sum = 0while num <= 1000: num = num + 1 if num % 2 == 0: continue sum = sum + numprint(sum)
上面是我写的代码,我理解的continue意思是如果满足了if的条件,就继续,所以我是算数偶数后进行相加的,但是答案应该是
if num % 2 == 1:
这个到底要怎么理解呢?
num = 0sum = 0while num <= 1000: num = num + 1 if num % 2 == 0: continue sum = sum + numprint(sum)
上面是我写的代码,我理解的continue意思是如果满足了if的条件,就继续,所以我是算数偶数后进行相加的,但是答案应该是
if num % 2 == 1:
这个到底要怎么理解呢?
2020-12-03
举报