How do you prefer to split a long string in parts and concatenate them so as to avoid E501 and comply with PEP8? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

How do you prefer to split a long string in parts and concatenate them so as to avoid E501 and comply with PEP8?

Comma, +? Depends on the situation? Multiple print lines written on some log file? Docstrings, unless they're meant to be used under function definitions? (Are they?) If it depends, which do you think is better when? I've seen something elsewhere about avoiding + concatenation if possible, that it reduces readability and is prone to errors later on. And I have two very long strings.

22nd Apr 2022, 3:45 PM
KorkunƧ el Gato
KorkunƧ el Gato - avatar
1 Resposta
0
FF9900 Thank you for clearing that one up :-)
22nd Apr 2022, 4:54 PM
KorkunƧ el Gato
KorkunƧ el Gato - avatar