recursion with creating unique combinations
<p>I'm trying to write function that will be adding unique combinations to the list from given number.
For example when input = 3 I expect list with 123, 132, 213, 231 ... etc elements</p>

<pre><code>resultss = []

def fun(number, result=''):
    if len(result) == number:
        return resultss.append(result)
    else:
        for x in range(1, number + 1):
           if str(x) not in result:
               result += str(x)
               return fun(number, result)

fun(4)
print(resultss)
</code></pre>

<p>The problem is, this function adds only first combination 1234 for 4 for example.
Any solution?</p>