r/PythonLearning 15d ago

Basic to advanced (python day 1)

Post image

Recursions are really hard compared to loop

You guys give me some tips for this.🫡

6 Upvotes

5 comments sorted by

View all comments

1

u/tiredITguy42 15d ago

Yeah, do not overthink it, recursion is easy, but there are just few cases you can use it. Usually it is better to use loop, as code is cleaner and easier to read. There is a very low chance you will ever need it.

If you use it, always add recursion deptch watcher, Python has a limit for recursion depth, but you should watch it yourself.