Jul-08-2019, 09:42 PM
Hey. Thank you very much. Yes this solved my issue.
I have one last issue.
When I am trying to return "tempAllPaths" at line #72 to main function.
In main function, I have written following line :
finalPath = shortest(maxHeight, currentRow, currHeight, allPaths)
When I try to look at the length of the list, I get error.
Line : print("Length : "+str(len(finalPath)))
Error: print("Length : "+str(len(finalPath)))
TypeError: object of type 'NoneType' has no len()
I also tried storing "tempAllPaths" to a global variable before return statement at line #72.
And I thought to use the global variable directly in main function, but when I print the length
of the list in main function, it gives zero.
The following line : print("Length : "+str(len(finalPath)))
gives output : Length : 0
Please help me with this. Thanks in advance.
I have one last issue.
When I am trying to return "tempAllPaths" at line #72 to main function.
In main function, I have written following line :
finalPath = shortest(maxHeight, currentRow, currHeight, allPaths)
When I try to look at the length of the list, I get error.
Line : print("Length : "+str(len(finalPath)))
Error: print("Length : "+str(len(finalPath)))
TypeError: object of type 'NoneType' has no len()
I also tried storing "tempAllPaths" to a global variable before return statement at line #72.
And I thought to use the global variable directly in main function, but when I print the length
of the list in main function, it gives zero.
The following line : print("Length : "+str(len(finalPath)))
gives output : Length : 0
Please help me with this. Thanks in advance.