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!!
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

#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
