(solved) How to count letters in string using python | Sololearn: Learn to code for FREE!

+2

(solved) How to count letters in string using python

How to create a program that checks and outputs how many times ‘s’ comes in sicknesses please share the code

2/13/2021 3:30:21 AM

Yusuf M Hashmi

11 Answers

New Answer

+7

print('sicknesses'.count('s'))

+3

Use @ and a list of names appears

+3

Yusuf Hashmi If you want count of each character then you can try this https://code.sololearn.com/cebXGf11Gq58/?ref=app

+3

Yusuf Hashmi I know what you wanted but I provided solution to count each character if you want.

+2

visph please check the code, you missed a quotation mark

+2

and how do you tag each others names?

+1

∆BH∆Y thanks: corrected ;)

+1

thanks visph

+1

what did you mean?

+1

I Am AJ ! your code is also good but what i wanted was not this thanks

+1

def letter_count(text, letter): #your code goes here return text.count(letter) text = input() letter = input() print(letter_count(text, letter))