I have a variable x to which I want to assign a very long string. Since the string is pretty long I split it into 10 substrings. I would like to do something like this:
x =
'a very long string - part 1'+
'a very long string - part 2'+
'a very long string - part 3'+
...
'a very long string - part 10'
But turns out this is an invalid syntax. What is the valid syntax for that?
If you want a string with no line-feeds, you could
The
+operator is not necessary with string literals:Your case: