I want to get the each character count in a given sentence. I tried the below code and I got the count of every character but it displays the repeated characters count in the output. How to delete repeated character.
for i in x:
x=str(input("Enter a paragraph "))
check this code :
my_string = "count a character occurance" my_list = list(my_string) print (my_list) get_unique_char = set(my_list) print (get_unique_char) for key in get_unique_char: print (key, my_string.count(key))