Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python Exercise Example 84

Python Exercise Example 84

Python 100 Examples Python 100 Examples

**Problem:** Concatenate strings.

**Analysis:** None.

Example (Python 2.0+)

#!/usr/bin/python

-- coding: UTF-8 --

delimiter

=

'

,

'

mylist

=

[

'

Brazil

'

,

'

Russia

'

,

'

India

'

,

'

China

'

]

print

delimiter

.

join

(

mylist

)

The output of the above example is:


Brazil,Russia,India,China

Python 100 Examples Python 100 Examples