samedi 29 août 2020

What is the difference here in between these two python statements?

Can I know what is the difference here ? Assume A is 2d array and B is an int

if(A[i][j] == 2):
   res += B == 0

and

if(B == 0 and A[i][j] == 2):
   res += 1

Aucun commentaire:

Enregistrer un commentaire