Below written code prints the number of times the substring is present in the string. The code gives error for some test cases while correct answer for some? Please review the code.
string = input()
substring = input()
x = string.count(substring,0,len(string))
print(x)
One sample case where it gives error is [string - ininini and substring - ini]. It prints 2 as the answer while 3 is the correct solution.