FUNCTION TO CHECK IF A LETTER IS VOWEL OR CONSONANT IN PYTHON

Code:

def vow(C):
    vowel='AEIOUaeiou'
    if C in vowel:
        print(1)
    else:
        print(0)
    return 0

I/P:

vow('t')

O/P:

0

Other way

def isvowel(C):
    try:
        C = input("Enter the word")
        if C in "AEIOUaeiou":
            print(1)
        else:
            print(0)
    except:
        pass
    return 0

isvowel('t')

Leave a Reply