Python 编写一个将一个整数转化为二进制字符串的函数

如题所述

def tobin(num):
    if num>0: return tobin(num//2)+str(num%2)
    return ""

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答