Answers for "how to count characters in a string in python"

10

count characters in string python

>>> sentence = 'Mary had a little lamb'
>>> sentence.count('a')
4
Posted by: Guest on December-30-2020

Code answers related to "how to count characters in a string in python"

Python Answers by Framework

Browse Popular Code Answers by Language