is consonant python code example

Example 1: python3 vowels and consonants filter

def anti_vowel(c):
    newstr = c
    vowels = ('a', 'e', 'i', 'o', 'u')
    for x in c.lower():
        if x in vowels:
            newstr = newstr.replace(x,"")

    return newstr

Example 2: python3 vowels and consonants filter

class Vowels(object):
    def __init__(self, vowelList):
        self.vowelList = vowelList

        lettersList = self.vowelList.s.split(",")
        self.vowelList = [letter for letter in self.lettersList if letter in 'aeiou']

Example 3: check value vowel user input python

# taking user input
ch = input("Enter a character: ")

if(ch=='A' or ch=='a' or ch=='E' or ch =='e' or ch=='I'
 or ch=='i' or ch=='O' or ch=='o' or ch=='U' or ch=='u'):
    print(ch, "is a Vowel")
else:
    print(ch, "is a Consonant")