How to convert w/ or w/o decimal numbers to words // Python : <p>What I am going to add/improve to this code? Can it be done without importing num2words or inflect module? I've tried to mix some code with this code but none of them are working.</p>

<p>This is my improved code from <a href="https://codereview.stackexchange.com/questions/173971/converting-number-to-words">this original code.</a> Thank you in advance!</p>

<pre><code>one = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine']
tenp = ['Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen']
tenp2 = ['', '', 'Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety']

def once(num):
    word = one[int(num)]
    word = word.strip()
    return word

def ten(num):
    if num[0] == '1':
        word = tenp[int(num[1])]
    else:
        text = once(num[1])
        word = tenp2[int(num[0])]
        word = word + " " + text
    word = word.strip()
    return word

def hundred(num):
    word = ''
    text = ten(num[1:])
    word = one[int(num[0])]
    if num[0] != '0':
        word = word + " Hundred "
    word = word + text
    word = word.strip()
    return word

def thousand(num):
    word = ''
    pref = ''
    text = ''
    length = len(num)
    if length == 6:
        text = hundred(num[3:])
        pref = hundred(num[:3])
    if length == 5:
        text = hundred(num[2:])
        pref = ten(num[:2])
    if length == 4:
        text = hundred(num[1:])
        word = one[int(num[0])]
    if num[0] != '0' or num[1] != '0' or num[2] != '0':
        word = word + " Thousand "
    word = word + text
    if length == 6 or length == 5:
        word = pref + word
    word = word.strip()
    return word

test = int(input("Enter number(0-999,999):"))
a = str(test)
leng = len(a)
if leng == 1:
    if a == '0':
        num = 'Zero'
    else:
        num = once(a)
if leng == 2:
    num = ten(a)
if leng == 3:
    num = hundred(a)
if leng &gt; 3 and leng &lt; 7:
    num = thousand(a)
print(num)
</code></pre>

<p>This is the output of this code</p>

<pre><code>Enter number(0-999,999):123456
One Hundred Twenty Three Thousand Four Hundred Fifty Six
</code></pre>

<p>And I want it to be like this</p>

<pre><code>Enter number(0-999,999):123456.25
One Hundred Twenty Three Thousand Four Hundred Fifty Six and 25/100
</code></pre>
