How to make that multiply all numbers in list (Permutation) with smaller code?
<p>My problem is:</p>

<pre><code>    perm_list = list(range(a,b,-1))
    if len(perm_list) == 1:
       print(perm_list[0])
    elif len(perm_list) == 2:
       print(perm_list[0]* perm_list[1])
    elif len(perm_list) == 3:
</code></pre>

<p>I cant find a way to make that smaller if i can do it would be awesome.<br>
Because i will do that to 15, If i write that 15 times it will be bigger and more hard to write for me.<br>
  If there is a smaller was to make that can you guys please tell me?</p>

<p>Just use the <code>itertools</code> library</p>

<pre><code>from itertools import permutations
lst = list(range(3))
result = list(permutations(lst, 2))
print(result)
=&gt; [(0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1)]
print(list(permutations(lst, 3)))
=&gt;  [(0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0)]
</code></pre>

python python-3.x permutation