0
How to return the number of times a character repeats in a text fils
Counting number of times a character is in a text file https://code.sololearn.com/cqe2z4HpkxW1/?ref=app
2 Réponses
- 1
def CheckChar(text):
c = 0
for x in AlphaNumericList:
c += text.count(x); print(x, c);c = 0
+ 3
You can use the count() method on a string.
"dabidda".count("a") #returns 2