相关疑难解决方法(0)

Python:反斜杠后的'#'评论

这不起作用:

something = \
    line_of_code * \    #  Comment
    another_line_of_code * \    #  Comment
    and_another_one * \         #  Comment
    etc
Run Code Online (Sandbox Code Playgroud)

这也不是:

something = \
    #  Comment \
    line_of_code * \
    #  Comment \
    another_line_of_code * ...
Run Code Online (Sandbox Code Playgroud)

这也不是:

something = \
    ''' Comment ''' \
    line_of_code * \
    ''' Comment ''' \
    another_line_of_code * ...
Run Code Online (Sandbox Code Playgroud)

如果有一种方法可以将代码中的注释分成多行?

python format comments multiline backslash

43
推荐指数
1
解决办法
9126
查看次数

标签 统计

backslash ×1

comments ×1

format ×1

multiline ×1

python ×1