s = '4824'

def partitions_original(s):
    yield [s]
if len(s) > 2:
    for i in range(len(s) - 1, 0, -1):
        a = s[:i]
b = s[i:]
for g in partitions_original(b):
    yield [a] + g
list(partitions_original(s))
python all combinations of subsets of a string