Solution Pyramide

Ensemble =['+','o','-','#','=']

Out = True
while(Out) :
    C1 = input('Caractère 1 : ')
    for Val in Ensemble :
        if (C1 == Val) :
            Out = False
    if (Out) :
        print('Le caractère n\'est pas autorisé ')

Out = True
while(Out) :
    C2 = input('Caractère 2 : ')
    for Val in Ensemble :
        if ( (C2 == Val) and (C2 != C1) ):
            Out = False
    if (Out) :
        print('Le caractère n\'est pas autorisé ou déjà utilisé ')

Out = True
while(Out) :
    N = int(input('Nombre de colonnes : '))
    if (N > 23):
            print('Valeur trop grande !')
    elif (N%2 == 0):
            print('Le nombre doit être impair !')
    else:
            Out = False


for ligne in range (1,round(N / 2)+1):
    test1 = round(N / 2)  - ligne
    test2 = round(N / 2)  + ligne
    for col  in range (1,N+1):

        if ((col <= test1) or (col >= test2)):
            print(C1,end='')
        else :
            print(C2,end='')

    print('')