from random import randint debug = True mini = 0 maxi = 100 zahl = randint(mini, maxi) if debug: print(zahl) versuche = 1 while True: msg = "Anzahl Versuche %d\nBereich: %d bis %d" % (versuche, mini, maxi) tip = inputInt(msg) if zahl < tip: maxi = tip elif zahl > tip: mini = tip else: msgDlg("Super! %d Versuche" % (versuche)) break versuche+=1