← Back to challenges

Sum of v0w3ls

PythonHardlogicnumbersmathlanguage_fundamentals

Instructions

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 innokodakademija!") ➞ 12

Notes

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

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Book Shelf