Python内置函数进制转换的用法.docVIP

  • 1
  • 0
  • 约3.04千字
  • 约 3页
  • 2020-05-23 发布于河北
  • 举报
使用Python内置函数:bin()、oct()、int()、hex()可实现进制转换。 先看Python官方文档中对这几个内置函数的描述: 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. oct(x) Convert an integer number to an octal 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. int([number | string[, base]]) Convert a number or string to an integer. If no arguments are given, return 0. If a number is given, return number._

文档评论(0)

1亿VIP精品文档

相关文档