I need to take a string input and count the occurrence of a character only once per character(should not repeat for the same character) and print it in a list or set or tuple. But I'm not getting the desired result.
Code:
string1 = input('Enter your string: ')
for letter in string1:
string2 = string1.count(letter,0)
ss = str(string2)
print(ss)
Output:
Enter your string: ggddg
3
3
2
2
3