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 有限循环
时间: 2024-10-14 11:55:44
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 有限循环