Python - summation


def summation(num):
    if num == 1:
        return 1
    else:
        return num + summation(num-1)

n = int(input('please fill in an integer number :'))
ans = summation(n)
print('the result is :', ans)

雅思寫作11/10

  example resulted from chatgpt The line graph illustrates the monthly sales of four bakery products—baked bread, croissants, cupcakes, and ...