do...while loops

Magnus Lie Hetland mlh at idi.ntnu.no
Thu Feb 8 13:42:42 CET 2001


"D-Man" <dsh8290 at rit.edu> wrote in message
news:mailman.981487000.23183.python-list at python.org...
> On Tue, Feb 06, 2001 at 04:15:21PM +0000, Jay O'Connor wrote:
> | Aahz Maruch wrote:
[...]
> | > >>
> | > >> Why is is it while 1:
> | > >> would while 2:
> | > >> or   while 3: work?
> | > >
> | > >Yup - any non-zero number is considered true. They wouldn't do
anything
> | > >different, though, and they just might confuse someone. (Why 2?)
> | >
> | > Well, let's split the difference:
> | >
> | > while 2.5:
>
> Shouldn't that be 1.5 ?  ;-)

Actually, the average of 1, 2, and 3 (the values in question) should
be 2, shouldn't it? :)

--

  Magnus Lie Hetland      (magnus at hetland dot org)

 "Reality is what refuses to disappear when you stop
  believing in it"                 -- Philip K. Dick






More information about the Python-list mailing list