Advertisements
Advertisements
प्रश्न
How to set the limit for recursive function? Give an example.
Advertisements
उत्तर
Python also allows you to change the limit using sys.setrecursionlimit (limit value).
Example:
import sys
sys.setrecursionlimit(3000)
def fact (n):
if n = = 0:
return 1
else:
return n * fact (n – 1)
print (fact (2000))
APPEARS IN
संबंधित प्रश्न
A named block of code that is designed to do one specific job is called ______
Which function is called anonymous un-named function?
Read the following statement and choose the correct statement.
In Python, you don’t have to mention the specific data types while defining the function.
Write a Python code to check whether a given year is a leap year or not.
Write a Python code to find the L.C.M. of two numbers.
Explain the following built-in function.
id()
Explain the following built-in function.
chr()
Explain the following built-in function.
round()
Explain the following built-in function.
type()
Explain the following built-in function.
pow()
