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,35 @@
---
title: Python Ord Function
localeTitle: Python Ord函数
---
## Ord功能
`ord()`是Python 3中的内置函数用于将表示一个Unicode字符的字符串转换为整数 表示字符的Unicode代码。
#### 例子:
```
>>> ord('d')
100
>>> ord('1')
49
```
## chr功能
`chr()`是Python 3中的内置函数用于转换整数 将Unicode代码表示为表示相应字符的字符串。
#### 例子:
```
>>> chr(49)
'1'
```
有一点需要注意,如果传递给`chr()`的整数值超出范围则会引发ValueError。
```
>>> chr(-10)
'Traceback (most recent call last):
File "<pyshell#24>", line 1, in <module>
chr(-1)
ValueError: chr() arg not in range(0x110000)'
```