Why can't I xor strings?

Andrew Dalke adalke at mindspring.com
Fri Oct 8 20:43:36 EDT 2004


Grant Edwards:
> No, he explained exactly what he was trying to do, and it had
> nothing to do with encryption.  He wants to know if exactly one
> (1) of the strings is the empty string.

BTW, another way to get that is

if bool(str1) + bool(str2) == 1:
   print "one and only one of them was empty"


				Andrew
				dalke at dalkescientific.com



More information about the Python-list mailing list