I'm confused with this snippet of code:
t=0
while t<5: #currently loop runs for 10 seconds
print "in loop",t
if (t<5):
print "true"
t=t+0.01
prints in the last run through of the loop:
in loop 5.0
true
Now if it is true that t = 5.0 on the last pass through the loop, shouldn't the condition that t < 5 in the if statement not be met? And furthermore, shouldn't it not even be running through the loop for t=5 since it should have also failed the while condition?