Q:

Recursive function is not defined inside itself

I'm trying to write a program to solve the N Queens Puzzle. I'm getting the error name 'FindPosition' is not defined when the code tries to call FindPosition(finalArray, startArray) recursively. How do I properly call the function?
class TheQueensAlgoritm():

    def FindPosition(finalArray, startArray):

        if len(startArray)==0:
            print(finalArray)
            return
        else:
            startIndex = 0

            while startIndex <= len(startArray):
                finalIndex = len(finalArray) - 1

                while finalIndex >= 0:                                                        
                    if (not(startArray[startIndex] == finalArray[finalIndex] - finalIndex + startIndex) and not(startArray[startIndex] == finalArray[finalIndex] + finalIndex - startIndex)):
                        finalIndex = finalIndex - 1                    
                    else:
                        break
                    finalArray.append(startArray[startIndex])
                    startArray.remove(finalArray[-1])
                    FindPosition(finalArray, startArray)
                startIndex = startIndex + 1

            startArray.append(finalArray[-1])
            finalArray.remove(startArray[-1])
            FindPosition(finalArray, startArray)        

    startArray = []
    finalArray = []  
    boardSize = input("Type the size of the board = ")
    boardSize = int(boardSize)

    for i in range (0, boardSize):
        startArray.append(i) 

    finalArray.append(startArray[random.randint(0,boardSize-1)])  
    startArray.remove(finalArray[0])                              
    FindPosition(finalArray, startArray)

A:

FindPosition is a method of the class TheQueensAlgoritm and does not exist by itself. You need to use:
self.FindPosition(finalArray, startArray)

