python trouver tout l'occurrence en chaîne
pythonCopy#defining string and substring
str1 = "This dress looks good; you have good taste in clothes."
substr = "good"
#occurrence of word 'good' in whole string
count1 = str1.count(substr)
print(count1)
#occurrence of word 'good' from index 0 to 25
count2 = str1.count(substr,0,25)
print(count2)
Rajitha Amarasinghe