Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reinitializing list
#8
If finalPath is None, it is not reaching the return statement on line 72. I don't see another return statement, and the default return value is None.

Please don't use global variables, it's a real bad habit to get into. If you want to get tempAllPaths out of the function, return that instead of 1. It seems like you are returning 1 to indicate success. I would return tempAllPaths on success, and return an empty list for failure. The empty list can then be tested in a conditional, where it will resolve to False.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
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