def convertToBinary(n): """Function to print binary number for the input decimal using recursion""" if n > 1: convertToBinary(n//2) print(n % 2,end = '')# decimal numberdec = 34convertToBinary(dec)
本文共 265 字,大约阅读时间需要 1 分钟。
def convertToBinary(n): """Function to print binary number for the input decimal using recursion""" if n > 1: convertToBinary(n//2) print(n % 2,end = '')# decimal numberdec = 34convertToBinary(dec)
转载于:https://www.cnblogs.com/sea-stream/p/9985173.html