how to count periods latters in string python
<p>i need to count how many periods (points) appear in a string.</p>

<p>for example:</p>

<pre><code>str="hellow.my.word."
</code></pre>

<p>the code should return 3.</p>

<p>I tried to use the following function but it returns the length of the string. </p>

<pre><code> num=str.count('.')
</code></pre>

<p>What is the correct way to do it?</p>