+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Python Interview Questions and Answers

1
What is Python? What are the benefits of using Python?

Python is a programming language with objects, modules, threads, exceptions and automatic memory management. The benefits of pythons are that it is simple and easy, portable, extensible, build-in data structure and it is an open source.

2
Explain how python is interpreted.

Python program runs directly from the source code. Each type Python programs are executed code is required. Python converts source code written by the programmer into intermediate language which is again translated it into the native language / machine language that is executed. So Python is an Interpreted language.

3
What is PEP 8?

PEP 8 is a coding convention, a set of recommendation, about how to write your Python code more readable.

4
Name a module that is not included in python by default
  • mechanize
  • django
  • gtk
5
How is memory managed in python?
  • Memory management in Python involves a private heap containing all Python objects and data structures. Interpreter takes care of Python heap and that the programmer has no access to it.
  • The allocation of heap space for Python objects is done by Python memory manager. The core API of Python provides some tools for the programmer to code reliable and more robust program.
  • Python also has a build-in garbage collector which recycles all the unused memory. When an object is no longer referenced by the program, the heap space it occupies can be freed. The garbage collector determines objects which are no longer referenced by the sprogram frees the occupied memory and make it available to the heap space.
  • The gc module defines functions to enable /disable garbage collector:

gc.enable() -Enables automatic garbage collection.
gc.disable() - Disables automatic garbage collection.

Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US