Avatar ·

正确将行转移到Python

📁 列表, python, 示例

告诉我,有一个短语列表,但它们很长,pep8 对行长度有警告。

我使用符号 \ 转移部分短语,但随后它会计算所有空格。

示例:

list_of_words = ["""The weather is good.""", """Hot dog is the best food, \ It would be a sure sign that it was still yummy.""", """The girls are beautiful.""", """Anyone doesn’t matter, but after backslashes a huge \ distance between words. How to fix it?"""] print(*line_of_words)

输出:

The weather is good. Hot dog is the best food, it will be a sure sign that it was still yummy. T