How to print the most times a char occurs from a counter in python
<pre><code>Counter(str)
print max(Counter(str))
</code></pre>

<p>When this prints, it will print the letter in the string that occurs the most, I want to print how many times it occurs not what letter. How do I go about doing this?</p>

<p>A counter behaves like a dictionary, so this works:</p>

<pre><code>max(Counter(s).values())
</code></pre>

<p>Comment: Don't use <code>str</code> as your variable, because<br>
<code>str</code> is a type in Python.</p>

python counter