program to count no. of characters in a sentence python code example
Example 1: python return number of characters in string
# Example usage:
your_string = "Example usage"
len(your_string)
--> 13
Example 2: count characters in string python
>>> sentence = 'Mary had a little lamb'
>>> sentence.count('a')
4