one = 'one'
two = 'two'
three = 'three'
Are the 2 equivalent in time complexity?
result_1 = f'{one}{two}{three}'
result_2 = ''.join([one, two, three])
I know that join
works in linear time. But is the same true also for f-strings?
With f-strings, the number of strings being concatenated is always a constant, so I guess one could say it's constant time complexity, but I was more curious to know how the concatenation is implemented and how it would fare with a large number of strings.