simultaneous assignment

John Salerno johnjsal at NOSPAMgmail.com
Tue May 2 13:15:05 EDT 2006


Diez B. Roggisch wrote:

> I can't imagine what you're actually after here, but assuming that you
> really need this

Hard to explain because I'm still trying to figure out how to do it 
myself. I'm trying to solve a little puzzle using Python, even though 
I'm sure it's not necessary. Basically W, X, Y and Z are propositions 
that are either true or false, and the puzzle lists a few statements 
such as "Exactly one of X, Y and Z is true", and I'm trying to work out 
a little algorithm that might test for this kind of stuff.

Another thing I'm trying to do is write a function that tests to see if 
a list contains exactly one true item, and the rest are false (obviously 
this would have to be a list of boolean values, I guess). I'm sure this 
isn't a handy utility, but I enjoy figuring out how to implement it.



More information about the Python-list mailing list