bin函数
Posted shucomputerprogram
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了bin函数相关的知识,希望对你有一定的参考价值。
# 转为二进制字符串 # 整数 print(bin(-2)) # 负整数 ‘-0b10‘ print(bin(+2)) # 正整数 ‘0b10‘ # 非整数必须通过定义__index__()函数实现返回一个整数
更多:
oct函数
hex函数
特殊方法
__index__
__int__
以上是关于bin函数的主要内容,如果未能解决你的问题,请参考以下文章
-bash: /usr/bin/ls: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory(代码片段
在 Visual Studio 中创建构造函数的代码片段或快捷方式