What do we get if we reverse the vowels of a word or a sentence, maintaining the original capitalization of the vowels? The word multiMILLIONAIRE becomes meltiMALLOINIIRU.

multimillionaire

The catchphrase

And now for something completely different.

that featured in every episode of the surreal sketch comedy series Monty Python's Flying Circus becomes

End new fir semethong cimpletoly dofforant.

This comes horribly close to the way some BBC presenters pronounced this phrase that has long been a standard way of transitioning between unrelated topics. It's origin is credited to Christopher Trace, founding presenter of the BBC children's television programme Blue Peter, who used it (in all seriousness) as a link between segments. Now you know where the Monty Python group got its inspiration.

Assignment

Reverse the vowels of a word or a sentence, while maintaining the original capitalization of the vowels. The vowels are the letters a, e, i, o and u. This is done in the following way:

These functions may not make a distinction between uppercase and lowercase letters when determining if a character is a vowel.

Example

>>> vowels('multiMILLIONAIRE')
'uiIIOAIE'
>>> vowels('And now for something completely different.')
'Aoooeioeeiee'

>>> vowel_from_left('multiMILLIONAIRE', 5)
'O'
>>> vowel_from_left('And now for something completely different.', 1)
'A'

>>> vowel_from_right('multiMILLIONAIRE', 3)
'A'
>>> vowel_from_right('And now for something completely different.', 1)
'e'

>>> reversed_vowels('multiMILLIONAIRE')
'meltiMALLOINIIRU'
>>> reversed_vowels('And now for something completely different.')
'End new fir semethong cimpletoly dofforant.'