You have n dices each one having s sides numbered from 1 to s.
How many outcomes add up to a specified number k?
For example if we roll four normal six-sided dices we
have four outcomes that add up to 5. 
(1, 1, 1, 2)
(1, 1, 2, 1)
(1, 2, 1, 1)
(2, 1, 1, 1)
def outcome(n, s, k):
    if n == 0:
        return k == 0
    return sum(outcome(n-1, s, k-i) for i in range(1, s+1)) if n <= k <= s * n else 0
def outcome(n, s, k):
    if n == 0:
        return k == 0
    return sum(outcome(n-1, s, k-i) for i in range(1, s+1)) if n <= k <= s * n else 0