Function to count the number of items in a string 'a' in Python is ............... .

ICSE Class 10 Robotics & AI PYQ · 2026 Improvement · Section A

1(xix)1 Mark · 2026 · Section A · 2026 Improvement

Function to count the number of items in a string 'a' in Python is ............... .

Show SolutionHide Solution↓

string.count('a')

Reason — The count() function is a string method that counts the number of times a particular character or substring occurs in a string. Its correct syntax is string.count('a'). The other options are not valid Python string methods.

← Previous questionNext question →

Browse the free Robotics & AI sample bank