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 有限循环
时间: 2025-01-04 08:56:09
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 有限循环