Greg Christian wrote:
Is there a way to write an if statement that will pick up duplicates (two ‘1’s):
L = ['1', '4', '1']
if (L[0]) != (L[1]) != (L[2]):
print "THEY ARE NOT EQUAL"
else:
print "THEY ARE EQUAL"
When I run this code, it prints “THEY ARE NOT EQUAL” when it should print the
On Sun, May 1, 2011 at 2:28 PM, Greg Christian wrote:
> Is there a way to write an if statement that will pick up duplicates
> (two ‘1’s):
>
> L = ['1', '4', '1']
> if (L[0]) != (L[1]) != (L[2]):
> print "THEY ARE NOT EQUAL"
> else:
> print "THEY ARE EQUAL"
>
> When I run this code, it p
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/01/2011 02:28 PM, Greg Christian wrote:
> Is there a way to write an if statement that will pick up duplicates (two
> ‘1’s):
>
> L = ['1', '4', '1']
> if (L[0]) != (L[1]) != (L[2]):
> print "THEY ARE NOT EQUAL"
> else:
> print "THEY ARE
Is there a way to write an if statement that will pick up duplicates (two ‘1’s):
L = ['1', '4', '1']
if (L[0]) != (L[1]) != (L[2]):
print "THEY ARE NOT EQUAL"
else:
print "THEY ARE EQUAL"
When I run this code, it prints “THEY ARE NOT EQUAL” when it should print the
else “THEY ARE EQUAL”.