标签:pytho class blog 循环 col 偶数 == while pre
if 和 while循环
while循环:
输出1-100所有的数
num = 1 while num<=100: print(num) num += 1
输出1-100所有的偶数
num = 1 while num<=100: if num%2 == 0: print(num) num += 1
输出1-100所有的奇数
num = 1 while num<=100: if num%2 == 1: print(num) num += 1
标签:pytho class blog 循环 col 偶数 == while pre
原文地址:http://www.cnblogs.com/xxrens/p/7771826.html