jeudi 5 décembre 2019

how to use negative floating points in python if condition [closed]

I am using the below code but the negative values are not accepting by this loop.

if diff <= -.5  and ordertype == 'SELL':
  print("Sorry")
elif diff >=  -.15  and ordertype == 'SELL':
  print("ok")
  updatetrgger = f - .5
  print(updatetrgger)
  if updatetrgger <= d:
     print("no update")
  else:
    print("updatetrggerupdating")
    updatetrgger = str(updatetrgger)

Can someone let me know why this behaviour

Aucun commentaire:

Enregistrer un commentaire