Suppose I have several variables, e.g.: a, b, c, d, e, f, g.

I would like to be able to see if they're all the same, I don't care what
the value is, as long as they're equal.  If they're all equal to 0, or to
"spam", or to ["cleese", "idle", "gilliam"], as long as they're the same.

Is there a more pythonic way of doing this other than, 

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

For example, is there any kind of function:

if allsame(a, b, c, d, e, f, g):
   do stuff

I can roll my own, but I was just wondering if something already existed 
like this.

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to