Setting 1 space between two lines using python
Just add a space between the two lines:
a = "abcd" b = "xyz" c = a + " " + b # note the extra space concatenated with the other two print c it will give you
abcd xyz You can use a function like .join() , but for something so short that it would seem almost counter-intuitive (and IMO "overkill"). Ie, first create a list with two lines, then call a function with this list and use returning this function to the print statement ... when you can just combine the required space with 2 lines. Seems semantically clearer too.
Based on: "Simple is better than complex." (Zen Python "import this")
Python supports string formatting operations and a template system (the latter is a technically simple but powerful class) as part of a string module. Although the plus operator does its job, the lack of line formatting can greatly affect code readability. Basic example of string formatting:
c = '%s %s' % (a, b)