0

How will I write a python program to count characters.I Mean just a particular letter not the whole sentence

strings

20th Feb 2017, 12:13 AM
Wakaye 1
Wakaye 1 - avatar
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
20th Feb 2017, 1:29 AM
Jehad Al-Ansari
Jehad Al-Ansari - avatar
0
k
22nd Feb 2017, 2:26 AM
Wakaye 1
Wakaye 1 - avatar