chap1_act_5_3.py

created by 3-0-snt2de-2019

created on August 14, 2019

337 Bytes


mi, ma = 1, 100
e = (mi + ma)//2
print("Essaie :", e)
reponse = input("Gagné (=), Plus (+), Moins(-) ? ")
while reponse != "=":
    if reponse == "+":
        mi = e + 1
    if reponse == "-":
        ma = e - 1
    e = (mi + ma)//2
    print("Essaie :", e)
    reponse = input("Gagné (=), Plus (+), Moins(-) ? ")