求100以内的偶数
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了求100以内的偶数相关的知识,希望对你有一定的参考价值。
1、
num = 1 while num<=100: if num%2 ==0: print(num) num += 1
2、
for num in range(1,101): if num % 2 == 0: print(num)
while 无限循环
for 有限循环
以上是关于求100以内的偶数的主要内容,如果未能解决你的问题,请参考以下文章