Write a Python program to count the number of vowels in a given string. Your program should do the following:

ICSE Class 10 Robotics & AI PYQ · 2025 Paper · Section B

6(iii)Written · 2025 · Section B · 2025 Paper

Write a Python program to count the number of vowels in a given string. Your program should do the following:

Show SolutionHide Solution↓
st = "Artificial Intelligence"
count = 0
for ch in st:
    if ch in 'aeiouAEIOU':
        count += 1
print("Total number of vowels:", count)
Total number of vowels: 10
← Previous questionNext question →

Browse the free Robotics & AI sample bank