Reputation: 565
If I wanted to say something for a while loop such as: while time is greater than or equal to 0
, would it simply be written as while time > or == 0
? Or is there no way to do this?
Upvotes: 1
Views: 305
Reputation: 1
Counting in Python example:
time = 0
while time < 100:
time = time + 1
print time
Upvotes: 0
Reputation: 369424
Use while time >= 0
(equivalent to while time > 0 or time == 0
)
>>> 0 >= 0
True
>>> 1 >= 0
True
>>> -1 >= 0
False
Upvotes: 6