Mid2 14th_Character_Count_in_Listb

 sentence=['s','t','r','i','n','g','s']

string=input("Enter a character: ")
count=0
for i in sentence:
    if i==string:
        count+=1
print(count)
#output:
Enter a character: s 2

Comments

Popular posts from this blog

JAVA Lab Programs

HANGMAN GAME

WD 22. StylingLinks&Buttons