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