Which memory management technique does Python primarily utilize?
- Garbage Collection (GC)
- Manual Memory Management (malloc/free)
- Reference Counting
- Stack Allocation
Python primarily utilizes Garbage Collection (GC) for memory management. It automatically deallocates memory occupied by objects that are no longer in use, making memory management more convenient and reducing the risk of memory leaks.
Loading...
Related Quiz
- The ____ method in a metaclass is called when a new object is created from a class.
- Which data structure follows the Last In First Out (LIFO) principle?
- How can you implement a stack such that you can retrieve the minimum element in constant time?
- You've created a module mymodule.py, and inside it, there's a function named myfunc. However, when another developer tries to import myfunc using from mymodule import myfunc, they get an error that it doesn't exist. What could be the possible reasons?
- How would you ensure that a piece of code in a module is only executed when the module is run as a standalone program and not when it is imported?