I have a short question to my little Python-Code especially to the IF-Statement. I want to do something like this:
def functioName(x, y, size):
if (x==y):
return 'RED'
elif (x-y == 50):
return 'RED'
else:
return 'YELLOW'
Why can I not do x-y == 50
. I tried to calculate this outside of the statement like z=x-y
and only checked in the statement if z==50
but it didn't work.
Aucun commentaire:
Enregistrer un commentaire