0
How will I write a python program to count characters.I Mean just a particular letter not the whole sentence
strings
2 ответов
+ 4
"len" will give you the count of characters in a string.
Example:
mystring = "something"
print(len(mystring))
This will print : 9
-----
"count" function on a string will give a count of the sub-string you want to find.
Example:
mystring = "somethings"
print(mystring.count('s'))
This will print : 2
0
k