►
Run
#the string str = 'Hello World. Hello TutorialKart.' #substring substr = 'Hello' #finding number of occurrences of substring in given string count = str.count(substr) print("Number of occurrences of substring :", count)
Output