Here\'s a method I have in a larger project (Python 3.8):
def generateTree(board, depth): #turns position into all of it\'s further branches branche