You are viewing a single comment's thread. Return to all comments →
Here is the complete code as You are a beginner. This will Help...!!!
def count_substring(string, sub_string): count=0 #print(len(string),len(sub_string)) for i in range(0, len(string)-len(sub_string)+1): if string[i] == sub_string[0]: flag=1 for j in range (0, len(sub_string)): if string[i+j] != sub_string[j]: flag=0 break if flag==1: count += 1 return count
Seems like cookies are disabled on this browser, please enable them to open this website
Find a string
You are viewing a single comment's thread. Return to all comments →
Here is the complete code as You are a beginner. This will Help...!!!