Issue
how can i change this.
a= ['man, boy, mum']
into
a=['man', 'boy', 'mum']
I have tried replacing the commas with (') but it does not work. any help will be appreciated
Solution
Here is a quick answer for you
>>> a = ['man, boy, mun']
>>> result = a[0].split(',')
>>> result
['man', ' boy', ' mun']
Now you need to clean up the white spaces (' ').
Answered By - Gai Ashkenazy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.