Convert integer to English words
It's often best to write this kind of function along with its tests.  Let's start with a simple test:
import doctest;

def englishify(number):
    &quot;&quot;&quot;Format NUMBER into standard English form.
    NUMBER must be in range [0..999999]
    &gt;&gt;&gt; englishify(0)
    'Zero'
    &quot;&quot;&quot;

    return 'Zero'

if __name__ == '__main__':
    doctest.testmod()

Now, start adding more tests and make each one pass before moving on to the next.
You'll find that when you reach the bigger numbers, there's a useful recursive property.  We can split off the thousands and the hundreds, format each non-zero part separately, and then join using one of the techniques from Joining words together with a comma, and “and”.  For example, consider these inputs:

123456 ⟶ 123 Thousand , 4 Hundred and 56
123056 ⟶ 123 Thousand and 56
123400 ⟶ 123 Thousand and 4 Hundred

Now those individual numbers can be formatted into words (and the last case will have two &quot;and&quot;s in normal English: &quot;One hundred and twenty-three thousand, four hundred and fifty-six.'

Modified code
import doctest;

def englishify(number):
    &quot;&quot;&quot;Format NUMBER into standard English form.
    NUMBER must be in range [0..999999]
    &gt;&gt;&gt; englishify(0)
    'Zero'
    &gt;&gt;&gt; englishify(10)
    'Ten'
    &gt;&gt;&gt; englishify(20)
    'Twenty'
    &gt;&gt;&gt; englishify(99)
    'Ninety Nine'
    &gt;&gt;&gt; englishify(100)
    'One Hundred'
    &gt;&gt;&gt; englishify(101)
    'One Hundred and One'
    &gt;&gt;&gt; englishify(1001)
    'One Thousand and One'
    &gt;&gt;&gt; englishify(1201)
    'One Thousand, Two Hundred and One'
    &gt;&gt;&gt; englishify(123201)
    'One Hundred and Twenty Three Thousand, Two Hundred and One'
    &quot;&quot;&quot;

    Units = [None, 'One', 'Two', 'Three', 'Four', 'Five',
             'Six', 'Seven', 'Eight', 'Nine',
             'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen',
             'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen']
    Tens = [None, None, 'Twenty', 'Thirty', 'Forty', 'Fifty',
            'Sixty', 'Seventy', 'Eighty', 'Ninety']

    if number &lt; 20:
        return Units[number] or 'Zero'

    if number &lt; 100:
        return ' '.join(filter(None, [Tens[number//10], Units[number%10]]))

    # Larger numbers - break down and englishify each part
    parts = list(filter(None,
                        map(lambda quantity, number:
                                englishify(number) + quantity if number else None,
                            [' Thousand', ' Hundred', ''],
                            [number // 1000, number // 100 % 10, number % 100])))

    if len(parts) == 1:
        return parts[0]
    return ' and '.join([', '.join(parts[:-1]), parts[-1]])


if __name__ == '__main__':
    doctest.testmod()

The extension to support millions and more should now be obvious - just add the unit and its extraction to the list passed to map().