A quickie (I hope!).

I am running Python 2.7.10 (and, yes, I know, support for it has been
withdrawn.)

I have three tuples that have been generated separately and I want to check
that they are identical. all I want to do is to terminate the program and
report an error if all three are not identical.

My initial attempt to do this is to use logic of the form

if not (mytup1 == mytup2 == mytup3):
   raise Exception ("Tuples are not identical")

I have tried this logic form in IDLE, and it seems to do what I want.

Is this a reasonable way to do this, or is there a better way?

Thanks in anticipation.

Stephen Tucker.


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to