I found an interesting problem on https://www.codewars.com/kata/58cda88814e65627c5000045:
# Write Number in Expanded Form - Part 2

This is version 2 of my ['Write Number in Exanded Form' Kata](https://www.codewars.com/kata/write-number-in-expanded-form).

You will be given a number and you will need to return it as a string in [Expanded Form](https://www.mathplacementreview.com/arithmetic/decimals.php#writing-a-decimal-in-expanded-form). For example:

```python
expanded_form(1.24) # Should return '1 + 2/10 + 4/100'
expanded_form(7.304) # Should return '7 + 3/10 + 4/1000'
expanded_form(0.04) # Should return '4/100'
```

I tried it in Python, but could not do it. Can you solve it?
def expanded_form1(num):
    a = len(str(num))
    b = []
    for i,j in enumerate(str(num)):
        if j != '0':
            b.append(j+'0'*(a-i-1))
    return ' + '.join(b)

def expanded_form(num):
    a = str(num).index('.')
    m = int(str(num)[:a])
    n = '0' + str(num)[a+1:]
    b = []
    for i,j in enumerate(n[1:]):
        if j != '0':
            b.append(j+'/1'+'0'*(i+1))
    b = ' + '.join(b)
    if len(expanded_form1(m)) > 0:
        return expanded_form1(m)+' + '+b
    else:
        return b