1/15
Looks like no tags are added yet.
What is recursion in programming?
A function that calls itself.
What is a base case in recursion?
Conditions that stop the recursion.
What is the purpose of the call stack?
To manage function calls in a Last-In, First-Out (LIFO) manner.
What happens when a function finishes executing?
Its stack frame is popped off the call stack, returning control to the calling function.
What is mutability?
The ability of an object to be changed after it is created.
Give an example of a mutable data type in Python.
Lists.
What is the definition of refactoring code?
Restructuring code to improve its readability, maintainability, and/or efficiency without changing its external behavior.
What are docstrings used for?
To document modules, classes, functions, and methods.
What are comments in code?
Lines of code that are not executed, used to explain logic or provide context.
List a common string method in Python.
isupper() or isdigit() or find() or capitalize().
How can you check if a substring is present in a string?
By using the 'in' operator.
What technique can be used to simplify complex conditional statements?
Extracting common code into functions.
What tools can help understand code execution and debug in Python?
Online Python tutor or visualizer tools.
What is the importance of understanding call stacks?
It's crucial for debugging and understanding program flow.
How do you iterate through individual characters in a string?
Using loops, such as a for loop.
What is base conversion in programming?
Converting numbers between different bases, like binary, decimal, and hexadecimal.