Count character occurrences in a Python string
<p>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.</p>

<pre><code>def countwords(x):
    x=x.lower()
    for i in x:
        print(i,'in',x.count(i)) 

x=str(input("Enter a paragraph "))
countwords(x)
</code></pre>

<p>My output is:</p>

<p><a href="https://i.stack.imgur.com/ROiLZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ROiLZ.jpg" alt="enter image description here"></a></p>

<p>My output should not contain spaces count and repeated characters.. What to do....!!!</p>