Reputation: 71
I am trying to create a list of words or phrases in python 3. For example;
a = ('Hello World')
when i am trying to convert it to a list, this happens,
list(a)
['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd']
but i want it to be ['Hello World']
Please can anyone help?
Upvotes: 0
Views: 22
Reputation: 11
a='hello world' create a list object then add the string object into list object using list built in function n=[] n.append(a) print(n)
Upvotes: 0