我這段代碼是直接輸出結果的,沒有過程def demo(s): def inner(x,y): sum_List = [] for i in range(1,y+1): a = str(x)*i sum_List.append(int(a)) if i == y: result = print(sum(sum_List)) return s(result) return inner@demodef func(p): return pnum1= int(input('請輸入一個數字:\n'))num2= int(input('請輸入一個數字:\n'))func(num1,num2)