3 ms·
> now except now we also need a \ to make multiline expressions. You never need the backslash in Python to make multiple expressions. There's always a way to d
by BeetleB 2y ago
> now except now we also need a \ to make multiline expressions.
You never need the backslash in Python to make multiple expressions. There's always a way to do multiline using parentheses. Their own style guidelines discourage using backslash for this purpose.
- taormina 2y agoAnd you can also do it with triple quotation marks if strings are involved, but it’s still more work for the compiler that someone explicitly did, it’s not magic.
- BeetleB 2y agoPlain strings work fine. Python has the same behavior as C: If two strings separated by whitespace, it concatenates them. So if I have a long string, I start with an open parenthesis, type one string, go to the next line, and another, and so on over several lines. Python sees it all as one string. Very readable.