Created
March 30, 2011 03:02
-
-
Save folz/893783 to your computer and use it in GitHub Desktop.
takes a string and returns that string with all duplicate letters stripped out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def unique(s): | |
''' | |
@param s: | |
a string | |
takes a string and returns that string with all duplicate | |
letters stripped out | |
''' | |
i=0 | |
y={} | |
for c in s: | |
y[c]=i | |
return ''.join(c for c in y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment