26Jul2015 gratuitous use lambda and reduce in python Posted in python by eludom def removeDups(string): """Remove duplicate characters from a string""" return(reduce(lambda x,y: x if x[-1] == y else x+y, list(string))) return removeDups("ffoobbaarr") fobar Share this:TwitterFacebookLike Loading... Related