demo_regex_split.py:
import re #Split the string at every white-space character: txt = "The rain in Spain" x = re.split("\s", txt) print(x)
C:\Users\My Name>python demo_regex_split.py
['The', 'rain', 'in', 'Spain']