How to convert a list of strings into a list of sublists of string in Python

1 Answer

0 votes
lst = ['python', 'c++', 'php java c'] 
  
lst = [sub.split() for sub in lst] 
  
print(lst) 



'''
run:
 
[['python'], ['c++'], ['php', 'java', 'c']]

'''

 



answered Feb 14, 2020 by avibootz
...