Hello,
I had a question about the python while loop
I was doing quicktest to practice my python syntax and I ran into this one.
def num_digits(n):
count = 0
while n:
print n
count += 1
n = n / 10
return count
It seems like python interpret
while n:
as
while n != 0:
Now I couldn't find anything in the python doc about this default behavior.
Similar to mel interpreting
if(getAttr ($myObj+".visibility"))
for
if(getAttr ($myObj+".visibility")==1) by default.
Anyone can tell me if its a known fact and maybe point me to some docs, or just say from personal experience.
Thanks !