concat next line with previous
simon at brunningonline.net
Tue Sep 26 12:27:44 CEST 2006
On 26 Sep 2006 03:16:25 -0700, s99999999s2003 at yahoo.com
<s99999999s2003 at yahoo.com> wrote:
> what is the python way to concat 2 lines eg
> line 1 with some text
> line 2 with some text
> i want to bring line 2 up , such that i get one whole string.
> line 1 with some text line 2 with some text
line1 = "line 1 with some text"
line2 = "line 2 with some text"
# Simplest way:
line3 = line1 + line2
# More general - joining a sequence of strings, with delimiter
lines = [line1, line2]
line3 = ", ".join(lines)
simon at brunningonline.net,
More information about the Python-list