Use the internal split method of the string-class.
def split(string, separator): return string.split(separator)
- def split(string, separator):
split_list = []current_slice = ''for char in string:if char == separator:split_list.append(current_slice)current_slice = ''else:current_slice += charsplit_list.append(current_slice)return split_list- return string.split(separator)