# aniruddh doki # 4280 E # convert integer to binary number: the bin() method def convertBin(x:int)->str: return bin(x) # convert integer to binary number: the manual way way def convertManual(x): #output = ['0b'] output = "0b" start = x if start == 0: return '0b0' if start == 1: return '0b1' while start != 0: #output.append(str(start%2)) output += str(start%2) start //= 2 return output def main(): print('bin()') print(f'0: {convertBin(0)}') print(f'19: {convertBin(19)}\n') print('manual()') print(f'0: {convertManual(0)}') print(f'19: {convertManual(19)}\n') main()