bin(x):

英文说明:Convert an integer number to a binary string. The result is a valid Python expression. If x is not a Python int object, it has to define an __index__() method that returns an integer.

New in version 2.6.

中文说明:将整数x转换为二进制字符串,如果x不为Python中int类型,x必须包含方法__index__()并且返回值为integer;

参数x:整数或者包含__index__()方法切返回值为integer的类型;

版本:bin函数是python2.6中新增函数,使用时要注意版本问题。

相关文章:

  • 2021-06-05
  • 2022-01-02
  • 2021-05-24
  • 2021-06-17
  • 2021-12-31
  • 2021-08-14
猜你喜欢
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2021-08-06
相关资源
相似解决方案