Merge pull request #58 from Jasonnor/Jasonnor-patch-1

Fix code blocks without python suffix
This commit is contained in:
piglei 2020-10-16 10:06:50 +08:00 committed by GitHub
commit 75d6f97707
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