def list_clean(string):
 string = string.split(',')
 rstring = list()
 for element in string:
  rstring.append(element.strip(' '))
 return rstring

def list_clean ( string ) : string = string . split ( ',' ) rstring = list ( ) for element in string : rstring . append ( element . strip ( ' ' ) ) return rstring
transforms a comma seperated string to a list .