Sum of v0w3ls

Published by Matt in

Create a function that takes a string and returns the sum of vowels, where some vowels are considered numbers.

VowelNumber
A4
E3
I1
O0
U0

Examples

sum_of_vowels("Let\'s test this function.") ➞ 8

sum_of_vowels("Do I get the correct output?") ➞ 10

sum_of_vowels("I love edabit!") ➞ 12

Notes

Vowels are case-insensitive (e.g. A = 4 and a = 4).

Watch a quick demo on how Edabit works.