Created
February 2, 2020 22:54
-
-
Save y56/2bc6fc03143c460074857abcdd15d15b to your computer and use it in GitHub Desktop.
List of all unique characters in a string?
This file contains hidden or 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
https://stackoverflow.com/questions/13902805/list-of-all-unique-characters-in-a-string | |
``` | |
In [10]: ''.join(set('aaabcabccd')) | |
Out[10]: 'acbd' | |
``` | |
``` | |
In [1]: list(set('aaabcabccd')) | |
Out[1]: ['a', 'c', 'b', 'd'] | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment