liste=[]
for i in range(1,10001):
    liste.append(i)



def dicho(nbre_secret):
    debut = liste[0]
    fin = liste[9999]
    m=(debut+fin)//2
    cpt=0
    if nbre_secret<0 or nbre_secret>10000:
        return False
    while m!=nbre_secret:
        cpt=cpt+1
        if nbre_secret<m:
            print("test n° ", cpt, "sur intervalle de", debut, "à", m)
            fin = m
            m=(debut+fin)//2
        else:
            print("test n° ", cpt, "sur intervalle de", m, "à", fin)
            debut=m
            m=((debut+fin)//2 + 1)
    print("test n° ",cpt+1)
    print("Le nombre choisi était ", m)
    return True
        
        
    