CBSE · 083Class XII · 2024Section B1 mark

Question 23aii

2 April 2024 · Computer Science (083)

(ii) 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.

Answer

python
print(message.count("is"))