Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23218

Recursive function always returning None [duplicate]

$
0
0

Why does it return None and not the value?

def countdown(n):    if n == 0:        return("Blastoff!")    else:        print(n)        countdown(n-1)print(countdown(20))

Viewing all articles
Browse latest Browse all 23218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>