Answers for "chec how many times a substring in a string"

1

check how many times a substring appears in a string

a = '128532012'
print(a.count('0'))
#Prints: 1

print(a.count('12'))
#Prints: 2
Posted by: Guest on December-04-2020

Code answers related to "chec how many times a substring in a string"

Python Answers by Framework

Browse Popular Code Answers by Language