Why does this not work?

Donn Cave donn at drizzle.com
Tue Jan 7 02:35:24 EST 2003


Quoth Tetsuo <member16943 at dbforums.com>:
|
| You know you suck if the calculator you are making isn't required to add
| 2 and 2, and you still can't get it to work.
|
| s = 0
| c = 0
| def halfadder(a, b):
|     if a and b in (0, 1):
|         if a and b == 1:
|             s = 1
|             c = 0
|             print s, c

You know that
     if a and b in (0, 1):
     if a and b == 1:
are  different than
     if a in (0, 1) and b in (0, 1):
     if a == 1 and b == 1:

	Donn Cave, donn at drizzle.com




More information about the Python-list mailing list