Join list to a string : list « Buildin Function « Python






Join list to a string

Join list to a string
S = 'spammy'
L = list(S)
print L


L[3] = 'x'              # works for lists, not strings
L[4] = 'x'
print L

S = ''.join(L)
print S


           
       








Related examples in the same category

1.Change string to a listChange string to a list
2.Change string to a list and Reference its index Change string to a list and Reference its index
3.Convert string to a list and add them togetherConvert string to a list and add them together