Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reinitializing list
#7
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.
Reply


Messages In This Thread
Reinitializing list - by Shivesh - Jul-08-2019, 02:42 PM
RE: Reinitializing list - by ichabod801 - Jul-08-2019, 02:50 PM
RE: Reinitializing list - by Shivesh - Jul-08-2019, 05:30 PM
RE: Reinitializing list - by ichabod801 - Jul-08-2019, 05:36 PM
RE: Reinitializing list - by Shivesh - Jul-08-2019, 05:53 PM
RE: Reinitializing list - by ichabod801 - Jul-08-2019, 06:07 PM
RE: Reinitializing list - by Shivesh - Jul-08-2019, 09:42 PM
RE: Reinitializing list - by ichabod801 - Jul-08-2019, 09:50 PM
RE: Reinitializing list - by Shivesh - Jul-08-2019, 10:07 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020