In this example we will show how to split the string into substrings if it finds instances of the separator using the split() method in Python.
Source Code
my_str = 'I, love, Python'
print(my_str)
print(my_str.split(','))
Output:
I, love, Python
['I', ' love', ' Python']