首页
技术
登录
6mi
u
盘
搜
搜 索
技术
python3中的while语句、if语句
python3中的while语句、if语句
技术
2026-08-25
12
a = 1 while a <= 7: if a % 2 == 0: print(str(a) + " is even.") else: print(str(a) + " is odd.") a += 1
输出结果是:
r@r-Sys:~/python$ python3 4.py 1 is odd. 2 is even. 3 is odd. 4 is even. 5 is odd. 6 is even. 7 is odd.
转载请注明原文地址:https://ipadbbs.8miu.com/read-65516.html
最新回复
(
0
)