I need to “concatenate to a string in a for loop”. To explain, I have this list:
list = ['first', 'second', 'other']
And inside a for loop I need to end with this:
endstring = 'firstsecondother'
Can you give me a clue on how to achieve this in python?
That’s not how you do it.
is what you want.
If you do it in a
forloop, it’s going to be inefficient as string “addition”/concatenation doesn’t scale well (but of course it’s possible):