SolveIt is under development
SolveItNCERT · CBSE · NEET
Question 3 / 3 · latest first
✓ Board-verified
Computer Science · 2026 · 2 marks

CBSE 2026 · Central · Set 4 · Q26

The function given below is written to accept a string s as a parameter and return the number of vowels appearing in the string. The code has certain…

The function given below is written to accept a string $\displaystyle \mathbf{s}$ as a parameter and return the number of vowels appearing in the string. The code has certain errors. Observe the code carefully and rewrite it after removing all the logical and syntax errors. Underline all the corrections made.
def CountVowels(s):
    c=0
    for ch in range(s):
        if 'aeiouAEIOU' in ch:
            c=+1
    return(ch)
ShareWhatsAppTelegram

More from Functions

CBSE Class 12 Computer Science past-paper question from the 2026 board exam, with the answer as CBSE’s own marking scheme gives it. Where our answers come from.