I'm new to Python and can't find a way to insert a string into a list without it getting split into individual characters:
>>> list=['hello','world']
>>> list
['hello', 'world']
>>> list[:0]='foo'
>>> list
['f', 'o', 'o', 'hello', 'world']
What should I do to have:
['foo', 'hello', 'world']
Searched the docs and the Web, but it has not been my day.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…