+ 1
Is there a way to get how many times a letter is repeated in a string, how?
Example : aasdf Output : a is repeated 2 times
9 ответов
+ 8
# You can use the string method count
string.count(value)
+ 6
Yes, 《 Nicko12 》is right .I didn't know about that string function.Thanks to 《Nicko12 》I came to know about that function.
+ 5
Amit Kumar Sorry but I think he is trying to give you hints and clues to use for loop then it is up to you how you will make it count the characters.
The string method is the same with for loop anyway, When you use string.count(value), "for loop" is also happening in the background. Hope this makes sense🙂
+ 4
Yes it's possible.
+ 2
《 Nicko12 》 thank you string.count() helped. Also I know that I have to use loop and was looking for the function
+ 2
check out this solution using for loop to a particular character in a string
https://code.sololearn.com/cd4x24vejagU/?ref=app
+ 2
There are many ways to skin a cat
+ 1
Zatch bell how?
+ 1
Zatch bell lmao dude I think you misread my question 😂