Life is but a dream.

大栗出奇迹

自律

使用Python输出1-100内的所有偶数

 1 #! /usr/bin/env python3
 2 # -*- coding:utf-8 -*-
 3 
 4 # 输出1-100内所有的偶数
 5 
 6 count = 1
 7 
 8 while count < 101:
 9     tmp = count % 2
10     if tmp == 1:
11         pass
12     else:
13         print(count)
14     count += 1

 

posted @ 2021-09-16 17:41  大栗出奇迹  阅读(5838)  评论(0编辑  收藏  举报