# Tuesday, Oct 27, 2015 - Obtaining the BINARY string by a different algorithm def binary( theValue ): # The function header line here has focus on WHAT divisor = 1 # find the largest power of two <= theValue while divisor * 2 <= theValue: divisor = divisor * 2 b = "" # obtains the most significant digit FIRST while theValue > 0: b = b + str( theValue // divisor ) theValue = theValue % divisor print(divisor) divisor = divisor // 2 return b num = 193 print( binary(num), num ) num = 225 print( binary(num), num ) num = 753 print( binary(num), num )