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 194 views
1 answer 173 views
2 answers 235 views
1 answer 148 views
1 answer 96 views
1 answer 173 views
1 answer 115 views
...