Update 3-tips-on-numbers-and-strings.md

去掉多余空格
This commit is contained in:
Zhaoyz 2020-10-12 11:39:31 +08:00 committed by GitHub
parent f87c45f661
commit c0082a39df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -242,9 +242,18 @@ ZeroDivisionError: division by zero
这时,除了使用斜杠 `\` 和加号 `+` 将长字符串拆分为好几段以外,还有一种更简单的办法:**使用括号将长字符串包起来,然后就可以随意折行了**
```python
s = (
"There is something really bad happened during the process. "
"Please contact your administrator."
)
print(s)
def main():
logger.info(("There is something really bad happened during the process. "
"Please contact your administrator."))
logger.info(
"There is something really bad happened during the process. "
"Please contact your administrator."
)
```
#### 当多级缩进里出现多行字符串时