DEV Community

0R1
0R1

Posted on

RECURSION

Hello Good Day! just wanted to ask something about about recursion using python, what's the difference between having a return on recursive function and not just like this.

with return on recursive fucntion.
def fib(n):
if n == 0:
return 1
else:
return n * fib(n-1)

without return on recursive function
def n_to_1(n):
if n == 0:
return
else:
print(n)
n_to_1(n-1)

Top comments (0)

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Explore this insightful write-up, celebrated by our thriving DEV Community. Developers everywhere are invited to contribute and elevate our shared expertise.

A simple "thank you" can brighten someone’s day—leave your appreciation in the comments!

On DEV, knowledge-sharing fuels our progress and strengthens our community ties. Found this useful? A quick thank you to the author makes all the difference.

Okay