Exercice : Combinaisons et triangle de Pascal

★★ Avancé

On considère la fonction suivante écrite en langage Python :

def calcul_somme(n):
    L = [1]
    for i in range(1, n + 1):
        ligne = [1]
        for j in range(len(L) - 1):
            ligne.append(L[j] + L[j + 1])
        ligne.append(1)
        L = ligne
    
    total = 0
    for k in range(len(L)):
        if k % 2 == 0:
            total += L[k]
    return total

Déterminer la valeur renvoyée par l'appel calcul_somme(6).