← Back to challenges

Extend the Vowels

PythonHardstringsregex

Instructions

Create a function that takes a word and extends all vowels by a number num.

Examples

extend_vowels("Hello", 5) ➞ "Heeeeeelloooooo"

extend_vowels("Innokodakademija", 3) ➞ "EEEEdaaaabiiiit"

extend_vowels("Extend", 0) ➞ "Extend"

Notes

Return "invalid" if num is not a positive integer or 0.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Binary to Decimal Converter