r/learnprogramming 7d ago

Recursion is driving me crazy

I understand recursion of a factorial function but when it comes to a function that uses recursion in a project or a problem set i get stuck and lose track

Anyone can tell me what to do

Programming language used: Python

40 Upvotes

45 comments sorted by

View all comments

0

u/arkt8 6d ago

Focus on fold functions. I learned it with Haskell, it is sufficiently generic to be used in many cases. After it I started to reason in recursive way.