Is there a way to remove duplicate characters? For example if we input "hello", the output will be "helo"; another example is "overflow", the output would be "overflw"; another example "paragraphs", the output would be "parghs".
I have tried
def removeDupes(mystring):
newStr = ""
for ch in string:
if ch not in newStr:
newStr = newStr + ch
return newStr