Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. list = []
  2. def convert_string_list(string): # this code converts string to list
  3.     for e in string:
  4.         list.append(e)
  5.    
  6. def convert_nonalpha_space(string, seperator): # this code converts elements in string that is found in seperator to space
  7.     convert_string_list(string)
  8.     i = 0
  9.     n = len(list)
  10.     while i < n:
  11.         if list[i] in seperator:
  12.             list[i] = "  "
  13.         i += 1
  14.     return list
  15.  
  16. def better_splitter(string, seperator): #
  17.     #new_list = convert_nonalpha_space
  18.     #new_string = ''.join(new_list)
  19.     #return new_string.split()
  20.     return ''.join(convert_nonalpha_space).split()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement