i need to count how many periods (points) appear in a string.
for example:
str="hellow.my.word."
the code should return 3.
I tried to use the following function but it returns the length of the string.
num=str.count('.')
What is the correct way to do it?