Search code examples
pythonstringconcatenation

How can strings be concatenated?


How to concatenate strings in python?

For example:

Section = 'C_type'

Concatenate it with Sec_ to form the string:

Sec_C_type

See also: How do I put a variable’s value inside a string (interpolate it into the string)? for more complex cases.


Solution

  • The easiest way would be

    Section = 'Sec_' + Section
    

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