We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好,很棒的一系列文章!阅读过程发现个小问题,该文章的此处:
https://github.com/piglei/one-python-craftsman/blob/master/zh_CN/3-tips-on-numbers-and-strings.md
但是这样写会破坏整段代码的缩进视觉效果,显得非常突兀。要改善它有很多种办法,比如我们可以把这段多行字符串作为变量提取到模块的最外层。不过,如果在你的代码逻辑里更适合用字面量的话,你也可以用标准库 textwrap 来解决这个问题:
textwrap
from textwrap import dedent def main(): if user.is_active: # dedent 将会缩进掉整段文字最左边的空字符串 message = dedent("""\ Welcome, today's movie list: - Jaw (1975) - The Shining (1980) - Saw (2004)""")
Code block 上少了 python suffixed:
如果不介意,我可以发个PR协助修正
The text was updated successfully, but these errors were encountered:
好的,谢谢。
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
您好,很棒的一系列文章!阅读过程发现个小问题,该文章的此处:
https://github.com/piglei/one-python-craftsman/blob/master/zh_CN/3-tips-on-numbers-and-strings.md
Code block 上少了 python suffixed:
如果不介意,我可以发个PR协助修正
The text was updated successfully, but these errors were encountered: