The while Statement : While : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » While »

 

The while Statement


count = 0
x = 10

while x > 0:
    x = x // 2            # truncating division
    count += 1
print "The approximate log2 is", count



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» While