# a Python closure function mimics a functor
# a functor can remember initial information

def make_strip(chrs):
    """a functor to strip c in chrs from string mystr"""
    def inner(mystr):
        return ''.join(c for c in mystr if c not in chrs)
    return inner


# characters to strip
chrs = ',;:.?!'

# set up the functor, pass initial data
strip_punctuations = make_strip(chrs)

mystr1 = 'Please, strip punctuations from this string!'
print(strip_punctuations(mystr1))

mystr2 = 'If you are here, you are lost!'
print(strip_punctuations(mystr2))

"""
my result -->
Please strip punctuations from this string
If you are here you are lost
"""