This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Deshpande
Recipients Deshpande, docs@python
Date 2019-07-12.20:50:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562964607.44.0.971161139684.issue37575@roundup.psfhosted.org>
In-reply-to
Content
In section 3.1.2 of the python documentation, its mentioned as below:

Two or more string literals (i.e. the ones enclosed between quotes) next to each other are automatically concatenated.
This feature is particularly useful when you want to break long strings:
This only works with two literals though, not with variables or expressions:

However, the concatination operation works on variables and expressions also.
Please find the below python code snippet and the output:

Python Code:
-------------
s1='Hello'
s2=' World '
s3=' How are you ? '
print(s1, s2, "\n", s3, "\n")
print('---------------------------')
print('Long time ' 'No see mate ')
print("Hope ", 'All is ' "good")
print('---------------------------')
print(s1, 'World'," !!")
print((s1+s2+s3)*2," there ?")


Output:
--------
Hello  World                                                                                                          
  How are you ?                                                                                                       
                                                                                                                      
---------------------------                                                                                           
Long time No see mate                                                                                                 
Hope  All is good                                                                                                     
---------------------------                                                                                           
Hello World  !!                                                                                                       
Hello World  How are you ? Hello World  How are you ?   there ?
History
Date User Action Args
2019-07-12 20:50:07Deshpandesetrecipients: + Deshpande, docs@python
2019-07-12 20:50:07Deshpandesetmessageid: <1562964607.44.0.971161139684.issue37575@roundup.psfhosted.org>
2019-07-12 20:50:07Deshpandelinkissue37575 messages
2019-07-12 20:50:07Deshpandecreate