python how to check how many letters in a string code example
Example 1: python return number of characters in string
# Example usage:
your_string = "Example usage"
len(your_string)
--> 13
Example 2: pyton count number of character in a word
# Count number of characters in a string (word)
a = "some string"
print len(a) # 11
Example 3: count characters in string python
>>> sentence = 'Mary had a little lamb'
>>> sentence.count('a')
4