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
Als we de klinkers van het woord multiMILLIONAIRE omkeren, met behoud van de posities van hoofdletters en kleine letters, dan krijgen we het woord meltiMALLOINIIRU.

The catchphrase

And now for something completely different.

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

End new fir semethong cimpletoly dofforant.

This comes horribly close to the way some BBC2 presenters pronounced this phrase that has long been a standard way of transitioning between unrelated topics. It's origin is credited to Christopher Trace3, founding presenter of the BBC children's television programme Blue Peter4, 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.'