Classifying articles under Python

Python version: 3.5.2

Suppose the following is the string we want to connect

 String to connect to

1、 + connection

Yes js You should know

 print(text[0] + text[1] + text[2])

output

 heyheyfuckworld

If you don't consider the memory space, it doesn't matter. The amount of data is huge, and the memory operation is frequent and cumbersome

2、 Space connector

 print(text[0] text[1] text[2])

output

 heyheyfuckworld

I don't know why, You can connect with and without spaces #Can laughing and crying be regarded as Python exclusive?

3、 Place holder connection

Don't tell people who don't know C language printf("%s","str");

 print("%s%s%s" % (text[0], text[1], text[2]))

output

 heyheyfuckworld

4、 Join function join

In fact, what we recommend is the best use join() efficient

 #T is the character 
 t = '-' 
 print (t.join (text))

output

 heyhey-fuck-world

5、 * connection

This one can find its own place

 str = 'abc'
str * 2

output

 abcabc

Anyway, I don't think there is any egg for me. I can't use it now. Ha ha