Loading your feed…
Recursion का मतलब है: एक function खुद को ही call करे, पर हर बार problem छोटी हो।
हर recursive function में दो चीज़ें ज़रूरी हैं:
def factorial(n):
if n == 0: # base case
return 1
return n * factorial(n - 1)
Base case भूल गए तो program कभी नहीं रुकेगा।
Answers, step-by-step code solutions, and community discussions are reserved for verified members. Create your free account in 30 seconds to unlock answers, ask follow-up questions, and connect with peers.