Menu
Depends on what you want to do with them. If you want to see how many times one was used, you could count them:
from collections import Counter
in_string = “For £10 pounds you can get $20^, in my dreams!!!”
c = Counter(in_string)
print(c)
Result:
Counter({‘ ‘: 9, ‘o’: 3, ‘n’: 3, ‘!’: 3, ‘r’: 2, ‘0’: 2, ‘u’: 2, ‘d’: 2, ‘s’: 2, ‘y’: 2, ‘a’: 2, ‘e’: 2, ‘m’: 2, ‘F’: 1, ‘£’: 1, ‘1’: 1, ‘p’: 1, ‘c’: 1, ‘g’: 1, ‘t’: 1, ‘$’: 1, ‘2’: 1, ‘^’: 1, ‘,’: 1, ‘i’: 1})
If you just want to know which were used you can use a set, and then sort them if you like:
s = set(in_string)
print(“”.join(sorted(s)))
Result:
!$,012F^acdegimnoprstuy£