[Tutor] While truth
Ian D
duxbuz at hotmail.com
Tue May 20 10:25:48 CEST 2014
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.
More information about the Tutor
mailing list