Jorge
0
Q:

python return number of characters in string

# initializing string  
test_str = "Grepper Answer"
  
# using count() to get count  
# counting e  
counter = test_str.count('e') 
>> 3
9
# Example usage:
your_string = "Example usage"
len(your_string)
--> 13
1
# Count number of characters in a string (word)
a = "some string"
print len(a)       # 11
0
a = "some string"
print (len(a))       # 11
1

New to Communities?

Join the community