python-005(1-100奇数和偶数)

# 输出 1-100 的奇数
start = 1
while start <= 100:
    temp = start % 2
    if temp == 1:
        print(start)
    else:
        pass
    start += 1

# 输出1-100 偶数
start = 1
while start <= 100:
    temp = start % 2
    if temp == 1:
        # print(start)
        pass
    else:
        # pass
        print(start)
    start += 1

 

posted @ 2020-05-10 09:34  haven_rui  阅读(413)  评论(0编辑  收藏  举报