So, what i want to basically know is how does python implement string concatenation More specifically
a = "string1"
b = "str2"
print(a + b) # string1str2
print(b + a) # str2string1
In the case of (a+b) does python make a new object by adding 4 characters at the end of a and returning the new object by taking O(4) time and O(7) for "b+a" or does it use a complicated data structure like linked list to just link the head of one string to the end of another?
Thanks in Advance and let me know if you want more detail.