Answers for "loop through words in a string python"

-1

loop through words in a string python

str = 'Hello! I am Robot. This is a Python example.'

#split string
splits = str.split()

#for loop to iterate over words array
for split in splits:
	print(split)
Posted by: Guest on September-11-2020

Code answers related to "loop through words in a string python"

Python Answers by Framework

Browse Popular Code Answers by Language