def nearest_square(y):
        """ 
        Takes an integer argument limit, and returns the largest square number 
        that is less than limit. A square number is the product of an 
        integer multiplied by itself, for example 36 is a square number because 
        it equals 6*6.
        """
        x = 0  
        while( x ** 2 <= y ): x += 1
        if x >= 1: return (x - 1) ** 2
        else: return 0