[Tutor] checking for a condition across a list

Sheila King sheila@thinkspot.net
Sun, 13 May 2001 23:01:01 -0700


On Mon, 14 May 2001 01:57:15 -0400, Pijus Virketis <virketis@fas.harvard.edu>
wrote about RE: [Tutor] checking for a condition across a list:

:Oh, and one more thing. I've never before encountered the "return x ==1"
:statement before. What exactly does it do?

x == 1

is a boolean condition. Either it is true or false.
If x is one, then the statement is true. If x is not one, then it is false.
The operator == checks if the two values are equal. If yes, then true, else
false.

It returns, therefore, a zero if false, and a one if true.

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/