We define the score of permutations of combinations, of an integer number (the function to obtain this value:```sc_perm_comb```) as the total sum of all the numbers obtained from the permutations of all the possible combinations of its digits.
For example we have the number 348.
```python
sc_perm_comb(348) = 3 + 4 + 8 + 34 + 38 + 48 + 43 + 83 + 84 + 348 + 384 + 834 + 843 + 438 + 483  = 3675
```
If the number has a digit 0, the numbers formed by a leading 0 should be discarded:
```python
sc_perm_comb(340) = 3 + 4 + 34 + 30 + 40 + 43 + 340 + 304 + 430 + 403 = 1631
```
If the number has digits that occur more than once, the score the adden will not be taken than twice or more:
```python
sc_perm_comb(333) = 3 + 33 + 333 = 369
```
If the number has only one digit its score is the same number:
```python
sc_perm_comb(6) = 6
sc_perm_comb(0) = 0
```

Enjoy it!!

Difficulty: introductory

Starter code:

def sc_perm_comb(num):
	

Solutions:
from itertools import permutations

def sc_perm_comb(num):
    sNum = str(num)
    return sum({ int(''.join(p)) for d in range(1, len(sNum)+1) for p in permutations(sNum, d) })

import itertools

#With combinations, we allow leading zeros, e.g. '03' is allowed, because when we permute, '03' becomes '30'  
def getAllCombinations(numStr, numDigits):
    combedDigits = []
    for d in range(1, numDigits+1):     #interval [1, numDigits]
        numList = [(''.join(p)) for p in itertools.combinations(numStr, d) ]
        uniqueNumList = set(numList)
        combedDigits.append( uniqueNumList )

    return combedDigits
#-----end function


def sc_perm_comb( n ):
    numStr = str(n)
    numDigits = len(numStr)

    combStrList = getAllCombinations(numStr, numDigits)

    permSet = set()
    for numsOfDigitD in combStrList:
        for num in numsOfDigitD:
            allPerms = [int(''.join(p)) for p in itertools.permutations((num)) if p[0]!='0']
            permSet.update(set(allPerms))    #punch out all repeats

    totalSum  = sum( permSet )

    return totalSum
#---end function


import itertools


def sc_perm_comb(num):
    return sum([int(''.join(p)) for i in range(1, len(str(num)) + 1) for p in set(itertools.permutations(str(num), i)) if p[0] != "0" ])


import itertools
def sc_perm_comb(num):
    total=0
    for k in range(1,len(str(num))+1):
      t=set((itertools.permutations(str(num),k)))
      for l in t:
        temp=''.join(l)
        if(temp[0:1]!='0'):
            total+=int(temp)
    return total

sc_perm_comb=lambda n:sum({int(''.join(p))for r in range(len(str(n)))for p in __import__('itertools').permutations(str(n),r+1)})

from itertools import permutations
def sc_perm_comb(num):
    s = str(num)
    return sum({int(''.join(p)) for c, _ in enumerate(s, 1) for p in permutations(s, c)})

import itertools
def sc_perm_comb(num):
    line = []
    for i in range(len(str(num))):
        line += [int(''.join(n)) for n in itertools.permutations(list(str(num)), i+1)]
    return sum(set(line))