python check how many times substring in string code example
Example: check how many times a substring appears in a string
a = '128532012'
print(a.count('0'))
#Prints: 1
print(a.count('12'))
#Prints: 2
a = '128532012'
print(a.count('0'))
#Prints: 1
print(a.count('12'))
#Prints: 2