← Back to challenges

Transforming Words into Binary Strings

PythonHardstringsregex

Instructions

Write a function that transforms all letters from [a, m] to 0 and letters from [n, z] to 1 in a string.

Examples

convert_binary("house") ➞ "01110"

convert_binary("excLAIM") ➞ "0100000"

convert_binary("moon") ➞ "0111"

Notes

Conversion should be case insensitive (see example #2).

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Snail Goes Up the Stairs