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

2005-05-16 Thread Terry Carroll
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)

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

2005-05-15 Thread Danny Yoo
> > 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

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

2005-05-15 Thread Alan G
> 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 You don't want to use & coz its a bitwise comparison, so you should use 'and' if a == b and a == c and ... However you

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

2005-05-15 Thread Max Noel
On May 15, 2005, at 06:54, Terry Carroll wrote: > if (a == b & > a == c & > a == d & > a == e & > a == f & > a == g): > do stuff > Well, you can already try this: if a == b == c == d == e == f == g: do stuff -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "

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

2005-05-15 Thread jfouhy
Quoting Terry Carroll <[EMAIL PROTECTED]>: > 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", "gi

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

2005-05-14 Thread Terry Carroll
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 mo