def number_to_string(n, alphabet):
result = '<STR_LIT>'<EOL>base = len(alphabet)<EOL>current = int(n)<EOL>if current < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>", n)<EOL><DEDENT>while current:<EOL><INDENT>result = alphabet[current % base] + result<EOL>current = current // base<EOL><DEDENT>return result<EOL>
Given an non-negative integer ``n``, convert it to a string composed of
the given ``alphabet`` mapping, where the position of each element in
``alphabet`` is its radix value.

Examples::

    >>> number_to_string(12345678, '01')
    '101111000110000101001110'

    >>> number_to_string(12345678, 'ab')
    'babbbbaaabbaaaababaabbba'

    >>> number_to_string(12345678, string.ascii_letters + string.digits)
    'ZXP0'

    >>> number_to_string(12345, ['zero ', 'one ', 'two ', 'three ', 'four ', 'five ', 'six ', 'seven ', 'eight ', 'nine '])
    'one two three four five '