【发布时间】:2013-12-01 04:01:59
【问题描述】:
我有这段代码,我只是在玩,因为我是 python 新手,就是这样:
a = 0
while a < 10:
a = a + 1
print("A is Less than 10")
我想添加更多代码:
如果 a 大于 10 但小于 20,请打印:
我试过了:
a = 0
while a < 10:
a = a + 1
print("A is Less than 10")
while a < 20:
a = a + 1
print("A is More than 10, but less than 20.")
但所做的只是打印“A 大于 10,但小于 20”
基本上,python 中有“小于但大于”的函数吗?
顺便说一下,我正在运行第 3 版。
【问题讨论】:
标签: python python-3.x