Python hex() 函数
Python 3 教程
· 2019-02-05 11:27:42
描述
hex() 函数用于将10进制整数转换成16进制,以字符串形式表示。
语法
hex 语法:
hex(x)
参数说明:
- x -- 10进制整数
返回值
返回16进制数,以字符串形式表示。
实例
以下实例展示了 hex 的使用方法:
>>>hex(255)
'0xff'
>>> hex(-42)
'-0x2a'
>>> hex(1L)
'0x1L'
>>> hex(12)
'0xc'
>>> type(hex(12))
<class 'str'> # 字符串
点击查看所有 Python 3 教程 文章: https://www.codercto.com/courses/l/10.html
Practical Algorithms for Programmers
Andrew Binstock、John Rex / Addison-Wesley Professional / 1995-06-29 / USD 39.99
Most algorithm books today are either academic textbooks or rehashes of the same tired set of algorithms. Practical Algorithms for Programmers is the first book to give complete code implementations o......一起来看看 《Practical Algorithms for Programmers》 这本书的介绍吧!