Python Program to Count the Number of Characters in a String

def count_ch(s, c):
count=0
for i in s:
if i==c:
count+=1
return count
str=input("Enter a string:")
ch=input("Enter the character to be searched:")
count=count_ch(str, ch)
print("In "str, ch, "occurs", count, "times")