Joining strings : String join « String « Python






Joining strings

Joining strings

list1 =  [ "A", "B", "C", "D", "E", "F" ]
string2 = "___"

print "List is:", list1
print 'Joining with "%s": %s' \
   % ( string2, string2.join ( list1 ) )
print 'Joining with "-.-":', "-.-".join( list1 )


           
       








Related examples in the same category

1.Join a listJoin a list
2.String JOINString JOIN
3.Printing a ListPrinting a List
4.split and joinsplit and join
5.Splitting a StringSplitting a String