Number in words: recursive function
Nice use of """docstrings""".



This code is useless:

else:
    "Value out of bounds"


If the else clause is reached, the string statement is executed, with no effect.  Just like executing a docstring statement has no effect.

You want:

else:
    raise ValueError("Value of out bounds")




The function convert_to_word() returns strange values like "sevenhundredandtwentyfive", which is only useful for counting letters, and nothing else.  A more flexible return might be ["seven", "hundred", "and", "twenty", "five"], allowing the caller to count words, or letters ... or ... join the words with spaces.



Several recursive calls are unnecessary.

convert_to_word(x//100) could simply be num_word_map[x // 100], and convert_to_word(x % 10) could be num_word_map[x % 10].



Comparison of a floating point value and an integer for equality is dangerous x / 1000 == 1.  Simply use x == 1000.



For this problem, instead of storing the words in num_word_map, you could simply store the lengths of the words.  



Your """docstring""" usage is good.  You describe what the function does, what the parameters are, and what the return value is.  Someone wishing to use your functions would only need to type help(convert_to_word) and they should have all the information required to use the function.

There is no formal "right way" to format the docstrings, but there are some tools which expect things a certain way.

For instance

"""
... omitted ...

NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains
23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing
out numbers is in compliance with British usage.
Answer = 21124
"""


This docstring contains 2 examples with answers, and one answer to a large question.  You can embed examples in a """docstring""", and it can become a built-in test for your module.

"""
... omitted ...

Answer = 21124

NOTE: Do not count spaces or hyphens.  The use of "and" when writing
out numbers is in compliance with British usage.  For example:

&gt;&gt;&gt; len(convert_to_word(342))     # three hundred and forty-two
23

&gt;&gt;&gt; len(convert_to_word(115))     # one hundred and fifteen
20
"""


Starting at the &gt;&gt;&gt;, the text look like lines straight out of what you might see if you typed commands in a Python REPL.  The lines beginning with &gt;&gt;&gt; are the commands, and the lines below that are the command output.  The doctest module can read the docstrings in a module, find lines formatted this way, execute the commands, and verify the output matches the expected output.  You might run this as:

python3 -m doctest numbers-letters.py


The output of the above command should be nothing, because the tests would pass.  Let's add one more test in the doc string:

"""
... omitted ...

&gt;&gt;&gt; len(convert_to_word(342))     # three hundred and forty-two
23

&gt;&gt;&gt; len(convert_to_word(115))     # one hundred and fifteen
20

&gt;&gt;&gt; convert_to_word(115)
'one hundred and fifteen'
"""


Now running the doctest will produce output due to the failing test:

python3.8 -m doctest number-letters.py 
**********************************************************************
File "/Users/aneufeld/Documents/Stack Overflow/number-letters.py", line 23, in number-letters
Failed example:
    convert_to_word(115)
Expected:
    'one hundred and fifteen'
Got:
    'onehundredandfifteen'
**********************************************************************
1 items had failures:
   1 of   3 in number-letters
***Test Failed*** 1 failures.


The output doesn't match because the test output contains spaces, which the function doesn't actually produce.

Other tools exist which read the docstrings, such as the Sphinx documentation generator.  It has formatting requirements; read the docs for details.