如果我想说一些while循环,例如:while time is greater than or equal to 0,它会简单地写成while time > or == 0?或者没有办法做到这一点?
使用while time >= 0(相当于while time > 0 or time == 0)
>>> 0 >= 0
True
>>> 1 >= 0
True
>>> -1 >= 0
False
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
210 次 |
| 最近记录: |