Reverse Order of Vowels || PythonIn this we are going to see a basic program on Reverse Order of Vowels in Python Programming Language.

l = ['a','A','e','E','i','I','o','O','u','U']

def isVowel(c):
    if c in l:
        return True
    return False


def reverserVowel(str):
    j = 0
    vowel = [0] * len(str)
    str = list(str)

    for i in range(len(str)):
        if isVowel(str[i]):
            vowel[j] = str[i]
            j += 1

    for i in range(len(str)):
        if isVowel(str[i]):
            j -= 1
            str[i] = vowel[j]

    return ''.join(str)


str = input("Enter Text having some vowels: ")
print(reverserVowel(str))

#Coded by Saahil

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post