There is a list of strings, you need to stitch everything into one. For example:

>>> string_list = ['foo', 'bar', 'eggs'] >>> ... 'foobareggs' 

Is there any built-in method in Python for this task?
If not, how to implement it?

    2 answers 2

    The string has a join method.

     >>> string_list = ['foo', 'bar', 'eggs'] >>> ''.join(string_list) 'foobareggs' 
    • You can give a link to the documentation , where you can see this and other methods of strings - jfs

    If the method / function is missing / not familiar, you can always implement a bicycle with something like:

    reduce (lambda x, y: x + y, string_list)

    , but such questions will be easily solved if you pass - for example, the basics on the codeacademy - an easy, free and useful course