How can strings be concatenated?

michelle picture michelle · Apr 26, 2010 · Viewed 466.9k times · Source

How to concatenate strings in python?

For example:

Section = 'C_type'

Concatenate it with Sec_ to form the string:

Sec_C_type

Answer

mpen picture mpen · Apr 26, 2010

The easiest way would be

Section = 'Sec_' + Section

But for efficiency, see: https://waymoot.org/home/python_string/