[Tutor] How to verify all things are equal to one another

Terry Carroll carroll at tjc.com
Mon May 16 22:26:49 CEST 2005


Thanks to all who responded on this.  The commonly suggested:

> if a == b == c == d == e == f == g:
>   do stuff

Is just what I needed.  It never occurred to me that Python supported a 
construct like that.  I would have though this would have evaulated a la:

  if ((((((a == b) == c) == d) == e) == f) == g):




More information about the Tutor mailing list