samedi 4 avril 2015

Easier way to write conditional statement

Is there any prettier way to write this if-statement:



if not (self.is_legal(l) or self.is_legal(u) or self.is_legal(r) or self.is_legal(d))


I've tried this, but it didn't work.



if not self.is_legal(l or r or d or u)


Or maybe the first one is the prettiest?


Aucun commentaire:

Enregistrer un commentaire