• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
June 30, 2022 |460 Views
Python Program to Find if a Character is a Vowel or Consonant
Description
Discussion


In this video, we will learn how to find if a character is a Vowel or Consonant using Python. 
We have divided this video into 2 sections to find if a character is a Vowel or Consonant.

Below is the list of approaches that we will cover in this section:

1. Native method using loop
2. Using recursion.

Here to check vowels and consonants we will be using a flag method in the loop, if the given input matches the list of vowels then the flag will be True otherwise the given input will be consonant.

Another way is to use a recursion method, In recursion, we pass the input character and index number, if the character gets not matched at the given index then the function will get called again and passed character with incremented index. If the given character will get matched from the list that will return True otherwise it will return False.

Program to find whether a char is vowel or consonant: https://www.geeksforgeeks.org/program-find-character-vowel-consonant/

Read More