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.
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
- Python Revision tour – 1 Class 12 Notes
- Python Revision tour – 2 Class 12 Notes Notes
- Working with Functions Class 12 Notes
- Using Python Libraries Class 12 Notes
- File Handling Class 12 Notes
- Recursion Class 12 Notes
- Idea of Algorithmic Efficiency Class 12 Notes
- Data Visualization using Pyplot Class 12 Notes
- Data Structure Class 12 Notes
- Computer Network Class 12 Notes
- More on MySQL Class 12 Notes
MCQ for Class 12 Computer Science Python
- Python Revision tour – 1 Class 12 MCQs
- Python Revision tour – 2 Class 12 MCQs
- Working with Functions Class 12 MCQs
- Using Python Libraries Class 12 MCQs
- File Handling Class 12 MCQs
- Recursion Class 12 MCQs
- Data Visualization using Pyplot Class 12 MCQs
- Data Structure Class 12 MCQs
- Computer Network Class 12 MCQs
- More on MySQL Class 12 MCQs
Computer Science Class 12 Questions and Answers
- Python Revision tour – 1 Class 12 Questions and Answers
- Working with Functions Class 12 Questions and Answers
- Using Python Libraries Class 12 Questions and Answers
- File Handling Class 12 Questions and Answers
- Recursion Class 12 Questions and Answers
- Idea of Algorithmic Efficiency Class 12 Questions and Answers
- Data Structure Class 12 Questions and Answers
- More on MySQL Class 12 Questions and Answers
- Computer Network Class 12 Questions and Answers
- More on MySQL Class 12 Questions and Answers