# This function from lecture may be useful as a model for some of # your work on Problem Set 3. # # However, note that this function operates on lists, and you will # need to modify it so that it operates on strings. def rem_first(elem, values): """ removes the first occurrence of elem from the list values """ if values == []: return [] elif values[0] == elem: return values[1:] else: result_rest = rem_first(elem, values[1:]) return [values[0]] + result_rest