join(iterable) Method is used to concatenate elements in an iteratable sequence with specified characters to generate a new string .
( List of available connections List, You can also connect tuples tuple)
a = 'iqondfenfuanf'
list = [a for i in range(1,1000001)]
# print(list)
b = ''.join(list)
print(b)
requirement + Both sides of the number must be of the same type , Of course, during the splicing process , Neither of the two sequences being manipulated will be changed , Instead, a new sequence containing the same type of data will be created as the splicing result .
a = 'iqondfenfuanf'
b = ''
for i in range(1,1000001):
b += a
print(b)
Can compare the above two methods is that fast .
As for other methods like formatting %,format And so on are not official string splicing methods , It is more accurate to format strings .