Since Python\'s string can\'t be changed, I was wondering how to concatenate a string more efficiently?
string
I can write like it:
s += string
You write this function
def str_join(*args): return ''.join(map(str, args))
Then you can call simply wherever you want
str_join('Pine') # Returns : Pine str_join('Pine', 'apple') # Returns : Pineapple str_join('Pine', 'apple', 3) # Returns : Pineapple3