"""
Learning Goals:
 - Define and recognize base cases and recursive cases in recursive code
 - Read and write basic recursive code
"""

def recursiveAddCards(cards):
    print(cards)
    if cards == [ ]:
        return 0
    else:
        smallerProblem = cards[1:]
        smallerResult = recursiveAddCards(smallerProblem)
        return cards[0] + smallerResult

print(recursiveAddCards([2,3,7,4]))

####

def factorial(x):
    if x == 1:
        return 1
    else:
        smallerProblem = x-1
        smallerResult = factorial(smallerProblem)
        print("Output:", x * smallerResult)
        return x * smallerResult

print(factorial(5))