import random
low = 1
high = 32
x = random.randint(low,high)
s = True
prosp = 4
while s==True and prosp > 0:
    print "Απομένουν", prosp, "προσπάθειες."
    prosp = prosp - 1
    print "Μάντεψε τον αριθμό:", low , "-", high,
    y = int(input("_"))
    if y < low  or  y > high :
        print "Πληκτρολόγησες αριθμό εκτός ορίων."
        prosp = prosp + 1 
    elif y > x:
        print "Λάθος. Είναι μικρότερος."
        high = y - 1
    elif y < x:
        print "Λάθος. Είναι μεγαλύτερος."
        low = y + 1
    else:
        print "Σωστά!"
        s = False
if s==True:
    print "Ήταν ο",x
