How to iterate over words of string in Python

1 Answer

0 votes
s = 'python java c c++ php'

splits = s.split()

for word in splits:
	print(word)



'''
run:
    
python
java
c
c++
php

'''

 



answered Oct 28, 2020 by avibootz

Related questions

3 answers 291 views
3 answers 185 views
2 answers 235 views
1 answer 125 views
2 answers 239 views
1 answer 178 views
1 answer 179 views
...