I was just wondering if there is a simple way of doing this. i.e. Replacing the occurrence of consecutive characters with the same character.
For eg: - if my string is \
word = "something likeeeee tttthhiiissss" re.sub(r"(.)\1+", r"\1",word)