# Recursion in Python Class 12 Questions and Answers

Teachers and Examiners (CBSESkillEduction) collaborated to create the Recursion in Python Class 12 Questions and Answers. All the important Information are taken from the NCERT Textbook Computer Science (083) class 12.

Contents

## Recursion in Python Class 12 Questions and Answers

1. What is recursion?
Answer – Python also permits function recursion, allowing defined functions to call one another. A frequent idea in math and programming is recursion. It denotes that a function makes a call to itself. This has the advantage of allowing you to loop through data to arrive at a conclusion.

2. What are base case and recursive case?
Answer – Recursive functions are ones that make calls to themselves. The base case and the recursive case are its two main components. The prerequisite for stopping the recursion is the base case. When a function calls on itself, it is said to be in a recursive case.

3. Why is base case so important in a recursive function?
Answer – The basic case of a suitable recursive function must always exist: A method of returning without performing a recursive call is the basic case. In other words, it is the mechanism that puts an end to this cycle of recursive calls that keep getting bigger and bigger while a stack of function calls waits for other function calls to return.

4. When does infinite recursion occur?
Answer – A recursion will continue to make recursive calls indefinitely if it never hits a base case, and the programme will never come to an end. This is referred to as infinite recursion, and it is typically not recommended. A programme with infinite recursion won’t typically run forever in most programming environments.

5. Compare iteration and recursion.
Answer – Iteration and recursion are two alternative approaches to repeatedly carrying out a set of instructions. The key distinction between the two is that whereas in iteration we use loops like “for” and “while,” in recursion we utilise function calls to continually execute the statements inside the function body.

Computer Science Class 12 Notes

MCQ for Class 12 Computer Science Python

Computer Science Class 12 Questions and Answers

error: Content is protected !!