Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Functions: Recursion
#4
(Sep-10-2021, 12:52 PM)deanhystad Wrote: The instructions say print. Why are you using a list?

Your recursive function creates a list each time it is called. You append one value and return the list. The return value is not used. See the problem? You never grow the list because each time the function is called you make a new list. You need to make one list that is used for all function calls.
Thanks
Reply


Messages In This Thread
Functions: Recursion - by OmegaRed94 - Sep-10-2021, 11:55 AM
RE: Functions: Recursion - by deanhystad - Sep-10-2021, 12:52 PM
RE: Functions: Recursion - by OmegaRed94 - Sep-10-2021, 05:37 PM
RE: Functions: Recursion - by naughtyCat - Sep-10-2021, 03:18 PM
RE: Functions: Recursion - by OmegaRed94 - Sep-10-2021, 05:38 PM

Forum Jump:

User Panel Messages

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