English

Write the Python statement for the following task using built-in functions/method only: To display the number of occurrences of the substring "is" in a string named message. - Computer Science (Python)

Advertisements
Advertisements

Question

Write the Python statement for the following task using built-in functions/method only:

To display the number of occurrences of the substring "is" in a string named message
For example if the string message contains "This is his book" , then the output will be 3. 

One Line Answer

Solution

The count() function counts the number of occurrences of a substring in a string. 

shaalaa.com
  Is there an error in this question or solution?
2023-2024 (February) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×