def clean_up(l):
'''list of str->list of str
The functions takes as input a list of characters.
It returns a new list containing the same characters as l except
that
one of each characters that appears odd number of times in l is
removed
and all the * characters are removed
>>> clean_up(['A', '*', '$', 'C', '*', '*', 'P', 'E',
'D', 'D', '#', 'D', 'E', 'B', '$', '#'])
['#', '#', '$', '$', 'D', 'D', 'E', 'E']
>>> clean_up(['A', 'B', '*', 'C', '*', 'D', '*', '*',
'*', 'E'])
[]
'''
def clean_up(l):
'''list of str->list of str
The functions takes as input a list of characters.
It returns a new list containing the same characters as l except that
one of each characters that appears odd number of times in l is removed
and all the * characters are removed
'''
result = []
for x in l:
if (x!='*') and (l.count(x)%2==0):
result.append(x)
return result
# Testing
print(clean_up(['A', '*', '$', 'C', '*', '*', 'P', 'E', 'D', 'D', '#', 'D', 'E', 'B', '$', '#']))
print(clean_up(['A', 'B', '*', 'C', '*', 'D', '*', '*', '*', 'E']))



def clean_up(l): '''list of str->list of str The functions takes as input a list of characters....