+ 1
How can we print the no. of repetition of each letter in the given word using Python language?
2 Antworten
+ 6
You can do it easily:
'yourwordhere'.count('o')
Will give you 2 as an answer.
+ 2
s = 0
for letter in word:
if(letter==your_letter):
s+=1
Or:
s = len([None for letter in word if letter==your_letter])