Q:

Write a Python program to remove duplicate characters of a given string

0

Write a Python program to remove duplicate characters of a given string.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

from collections import OrderedDict
def remove_duplicate(str1):
  return "".join(OrderedDict.fromkeys(str1))
     
print(remove_duplicate("python exercises practice solution"))
print(remove_duplicate("w3resource"))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now