def main():
    low = 1
    high = 100

    print("Think of a number between {} and {}".format(low, high))

    print("When you are ready,"
          " let me know and I will attempt to guess your number.")
    input("\nEnter anything and I will start: ")

    def valid_input():
        while True:
            reply = input("\nEnter 'low', 'high' or 'correct'.   ")
            if reply in ('low', 'high', 'correct'):
                return reply
            print("I do not understand what you wrote.")

    while True:
        guess = (low + high)//2
        print("I am guessing {}".format(guess))
        reply = valid_input()
        if reply == 'low':
            low = guess
        elif reply == 'high':
            high = guess
        else:
            print("Thank you for playing with me!")
            break

        if low == high:
            print("You cheated!")
            break
dataset/ETHPy150Open aroberge/pyproj/guess_number/guess_2a.py/main/original