Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #function naming, make sue it's a string
- def remove_duplicates(string):
- unique = ''.join(sorted(set(string)))
- removed = len(string) - len(unique)
- return unique, removed #returns the unique letters after duplicates are removed
- print(remove_duplicates('abbcddeffzzzifggg'))
Add Comment
Please, Sign In to add comment