[Tutor] While truth
Ian D
duxbuz at hotmail.com
Tue May 20 11:36:54 CEST 2014
Or should I have said While False is True, which is never True, because False is False not True
----------------------------------------
> From: duxbuz at hotmail.com
> To: tutor at python.org
> Date: Tue, 20 May 2014 08:25:48 +0000
> Subject: [Tutor] While truth
>
> I was reading a tutorial that had these examples in it:
>
>
>>>> while False:
>
> print("False is the new True.")
>
>
>>>> while 6:
>
> print("Which numbers are True?")
>
>
> while -1:
>
> print("Which numbers are True?")
>
>
> while 0:
>
> print("Which numbers are True?")
>
>
>
> Unfortunately the author never explained these statements.
>
>
> I was wondering if the gist of a while statement could be explained in the context of these examples.
>
>
> e.g. while False:
>
>
> means while True is False, which is never True because True is of course True not False.
>
>
> but while 6:
>
>
> means..... err while 6 is True? and this is True because... err.
>
>
> Anyway I am a bit lost with this.
>
>
> Can anyone shed any light please?
>
>
> Thanks.
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list