在源代码文件中,列表实际上可以跨越几行,缩进并不重要。
也可以在行末用续行字符\,将一条指令写成多行。\续行字符之后的一行中,缩进并不重要。
>>> a = [1, 2, 4,
66,
000]
>>> a
[1, 2, 4, 66, 0]
以上。但在print()中,续行字符\后的一行,输出的却不同。空格缩进都输出了。
print('This sentence is very long\
. You can not even see the \
end.')
This sentence is very long . You can not even see the end.
>>> print('hello hello\
see you later.\
Aligator')
hello hellosee you later.Aligator