#!/usr/bin/env python3

# Created by: Adam Diwani
# Created on: December 22, 2020
# This program guesses a number


import random

random_number = random.randint(1, 10)


def main():
    

    number_string = input("Enter a number 1-10: ")

    try:
        number = int(number_string)

        if number == random_number:
            print(" Correct! ")
        elif number < 0:
            print("This number is negative.")
        elif number != random_number:
            while number != random_number:
                number = int(number_string)
                if number > random_number:
                    print("HINT: the number is too big, please try again. ")
                    number_string = input("Enter a number: ")
                elif 0 <= number < random_number:
                    print("HINT: this number is too small, please try again.")
                    number_string = input("Enter a number: ")
                elif number < 0:
                    print("it isn't a positive number.")
                elif number == random_number:
                    print("Correct! ")
                    break
    except Exception:
        print("This was not a number")


if __name__ == "__main__":
    main()
