Number of cells in the Nth order figure | Function to return the number of cells in the nth order figure of the given type ; Driver code
def cntCells ( n ) : NEW_LINE INDENT cells = pow ( n , 2 ) + pow ( n - 1 , 2 ) ; NEW_LINE return cells ; NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT n = 3 ; NEW_LINE print ( cntCells ( n ) ) ; NEW_LINE DEDENT