- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Count the Number of Vowels in a string using Python?
Declare a string object containing all vowels.
>>> vowels='aeiou'
Set up a count variable initialize to 0
>>> count=0
Check if each character of input string belong to vowel string. If yes increment the count
>>> string='Hello How are you?' >>> for s in string: if s in vowels: count=count+1
In the end display value of count
>>> count 7
- Related Articles
- Python program to count the number of vowels using set in a given string
- Python program to count the number of vowels using sets in a given string
- Python program to count number of vowels using set in a given string
- How to count number of vowels and consonants in a string in C Language?
- C# Program to count number of Vowels and Consonants in a string
- C++ Program to count Vowels in a string using Pointer?
- Count and display vowels in a string in Python
- To count Vowels in a string using Pointer in C++ Program
- Java Program to count vowels in a string
- C# Program to count vowels in a string
- How to Count the Number of Vowels and Consonants in a Sentence in Golang?
- Count the number of vowels occurring in all the substrings of given string in C++
- How to get a number of vowels in a string in JavaScript?
- Java Program to count all vowels in a string
- C Program to count vowels, digits, spaces, consonants using the string concepts

Advertisements