11智能在线
新记
Python 编写一个将一个整数转化为二进制字符串的函数
如题所述
举报该文章
相关建议 2018-03-23
def tobin(num):
if num>0: return tobin(num//2)+str(num%2)
return ""
温馨提示:内容为网友见解,仅供参考
当前网址:
https://11.t2y.org/zz/fvfqqsfq477qmv8pm74.html
其他看法
无其他回答
相似回答
大家正在搜
相关问题
Python中如何获得一个整数的2进制的形式
python如何将整数转化成二进制字符串?
python编程将二进制转化为十进制(不用内置函数)
请用Python语言编程实现由十进制数到二进制数的转换,急求
python中,怎么样把特定的字符串转为二进制序列?
求帮忙用python做一个十进制转为2进制的程序,具体要求看...
Python语言编程实现由十进制数到二进制数的转换
python中,怎么样把特定的字符串转为二进制序列?