mardi 13 janvier 2015

Python: no if in second loop [duplicate]


This question already has an answer here:




Im not sure if Im nuts or something, but look at this code:



a=1
while a<=2.2:
if a==1.4:
print "OK"
a=a+0.4


output: "OK"


changed condition to 1.8:



a=1
while a<=2.2:
if a==1.8:
print "OK"
a=a+0.4


output: nothing!?


Can anyone help me here?


Aucun commentaire:

Enregistrer un commentaire