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."", ""Текст любой, не важно, но после бэкслэша огромное \ расстояние между словами. Как это исправить?""]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. The girls are beautiful. Текст л