Which approach is generally faster for concatenating many strings in a loop in Python?
Correct answer
C. ''.join(list_of_strings)
7 views
C. ''.join(list_of_strings)
7 views
join builds the result in a single pass, avoiding repeated copying.
Asked in: Python Interview Advanced
https://docs.python.org/3/library/index.htmlNot sure why the answer is C? Ask here and get an explanation.