fix(guide): simplify directory structure

This commit is contained in:
Mrugesh Mohapatra
2018-10-16 21:26:13 +05:30
parent f989c28c52
commit da0df12ab7
35752 changed files with 0 additions and 317652 deletions

View File

@ -0,0 +1,24 @@
---
title: Python Hex Function
localeTitle: Python十六进制函数
---
`hex(x)`是Python 3中的内置函数用于将整数转换为带有前缀“0x”的小写[十六进制](https://www.mathsisfun.com/hexadecimals.html)字符串。
## 论据
此函数接受一个参数`x` ,该参数应为整数类型。
## 返回
此函数返回带有前缀“0x”的小写十六进制字符串。
## 例
```
print(hex(16)) # prints 0x10
print(hex(-298)) # prints -0x12a
print(hex(543)) # prints 0x21f
```
![:rocket:](//forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=2 ":火箭:") [运行代码](https://repl.it/CV0S)
[官方文件](https://docs.python.org/3/library/functions.html#hex)