How to split a string by one or more spaces in Python

1 Answer

0 votes
string = 'python         java  c++ c         go'

lst = string.split()

print(lst)

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

'''
 

 



answered Jul 26, 2022 by avibootz

Related questions

1 answer 196 views
1 answer 176 views
2 answers 237 views
1 answer 150 views
1 answer 98 views
1 answer 175 views
1 answer 118 views
...