Python hex() 函数

Python 教程 · 2019-02-01 19:28:31

描述

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 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

Pro HTML5 and CSS3 Design Patterns

Pro HTML5 and CSS3 Design Patterns

Michael Bowers / Apress / 2011-11-15 / GBP 35.50

Pro HTML5 and CSS3 Design Patterns is a reference book and a cookbook on how to style web pages using CSS3 and HTML5. It contains 350 ready--to--use patterns (CSS3 and HTML5 code snippets) that you ca......一起来看看 《Pro HTML5 and CSS3 Design Patterns》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具