Avatar ·

النقل الصحيح للسطر إلى 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(*list_of_words)

النتيجة:

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