In this program, we will take a string as input and remove all duplicate characters from a string
Steps to solve the program
- Take a string as input.
- Import OrderedDict from collections to remove duplicate characters from a string.
- Print the output.
#Input string
string = "sqatools"
#Importing ordereddict
from collections import OrderedDict
#Printing output
"".join(OrderedDict.fromkeys(string))
Output :
'sqatol'