To understand recursion, you first need to understand recursion.
To understand recursion, you first need to understand recursion. It’s a joke, and it’s exactly how it works.
A function calls itself, every call waits on the stack, and the base case is what stops it.
Forget the base case and Python stops you at 1,000 calls deep: RecursionError.
Trap: this factorial stops at 1. What happens with factorial(0)? Comment it.
#python #programming #coding #computerscience #recursion
Comments
Comments from the original post on Instagram
No comments yet
