Python statements are usually written in a single line. The newline character marks the end of the statement. If the statement is very long, we can explicitly divide into multiple lines with the line continuation character (\).
Python supports multi-line continuation inside parentheses ( ), brackets [ ], and braces { }. The brackets are used by List and the braces are used by dictionary objects. We can use parentheses for expressions, tuples, and strings.
根据第二条规则,您可以将行拆分为
您可以沿着一行走下去,或者在所需位置使用
\
,如下所示:请记住
\
之后不能有任何空白或注释您可以执行以下简单操作:
相关问题 更多 >
编程相关推荐