Q. Write a program that reads a line, counts how many times the word 'is' appears in the line and then displays the count.


Answer :-

line = input("Enter a Line :-")
print("Number of 'is' in line :-" , line.count("is") )

Output :-

Enter a Line :-My name is pathwalla and my website name is pathwalla.com : )
Number of 'is' in line :- 2
>>>

3 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post