← Back to challenges

Dashed Vowels

PythonHardstringslogicformattingregex

Instructions

Create a function that takes a string and returns dashes on both sides of every vowel (a e i o u).

Examples

dashed("Innokodakademija") ➞ "-E-d-a-b-i-t"

dashed("Carpe Diem") ➞ "C-a-rp-e- D-i--e-m"

dashed("Fight for your right to party!") ➞ "F-i-ght f-o-r y-o--u-r r-i-ght t-o- p-a-rty!"

Notes

  • A string can contain uppercase and lowercase vowels.
  • Y is not considered a vowel.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Legendre's Formula