Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list = []
- def convert_string_list(string): # this code converts string to list
- for e in string:
- list.append(e)
- def convert_nonalpha_space(string, seperator): # this code converts elements in string that is found in seperator to space
- convert_string_list(string)
- i = 0
- n = len(list)
- while i < n:
- if list[i] in seperator:
- list[i] = " "
- i += 1
- return list
- def better_splitter(string, seperator): #
- #new_list = convert_nonalpha_space
- #new_string = ''.join(new_list)
- #return new_string.split()
- return ''.join(convert_nonalpha_space).split()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement