dimanche 25 avril 2021

Python: If statement runs even when bool condition is false [closed]

Any idea why this if-statement runs even thoug it is false?

The part of the function is the following one:

elif delta_x < 0:

    delta_t = abs(delta_x)/840

    y = int(abs(time_to_midnight - delta_t)) == 0

    if (int(abs(time_to_midnight - delta_t)) == 0):
        flow = 1

where,

delta_x = -120
delta_t = 0.14
time_to_midnight = 21

and y (boolean variable is False, as expected).

enter image description here

Aucun commentaire:

Enregistrer un commentaire