SyntaxFix
Write A Post
Hire A Developer
Questions
If order is not the matter:
>>> foo='mppmt' >>> ''.join(set(foo)) 'pmt'
To keep the order:
>>> foo='mppmt' >>> ''.join([j for i,j in enumerate(foo) if j not in foo[:i]]) 'mpt'