Fix code block without python suffixed

This commit is contained in:
Jason Wu 2020-10-15 22:24:58 +08:00 committed by GitHub
parent f87c45f661
commit 591d9783dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -262,7 +262,7 @@ def main():
但是这样写会破坏整段代码的缩进视觉效果,显得非常突兀。要改善它有很多种办法,比如我们可以把这段多行字符串作为变量提取到模块的最外层。不过,如果在你的代码逻辑里更适合用字面量的话,你也可以用标准库 `textwrap` 来解决这个问题:
```
```python
from textwrap import dedent
def main():
@ -284,7 +284,7 @@ def main():
比如:
```
```python
>>> 10_000_000.0 # 以“千”为单位划分数字
10000000.0
>>> 0xCAFE_F00D # 16进制数字同样有效4个一组更易读
@ -357,7 +357,7 @@ Python 的字符串有着非常多实用的内建方法,最常用的有 `.stri
我们可以用前面提到的 `dis` 模块来验证一下:
```
```python
def incr(value):
value += 1