Python is became one of the most used programming language today. It is being heavily used in Machine Learning. Here is the complete list of Python Interview Questions and Answers if you are looking to start or switch career in Python.
We know, an interviewer may ask you variety of different questions. We will keep this updated by adding more questions and answers, so you don’t have to look anywhere else when you are preparing for Python interview.
1] What is Python Programming Language?
Python is the high-level and general-purpose programming language.
It supports module and packages. It’s a object oriented programming language. It also supports threads and automatic memory management.
2] What is the Difference Between List and Tuple?
Tuples are immutable and list are mutable.
3] What is PEP 8 Python?
PEP stands for Python Enhancement Proposal. PEP 8 is set of rules or coding style you need to follow while writing code in Python. These standards make Python code more readable.
4] How Memory Management Being Done in Python?
It is managed by heap memory or space. Interpreter takes care of heap management in Python. Space allocation is done by Python memory manager. It also has a garbage collectors which frees memory from heap from unused objects.
5] What is Pickling and Unpickling in Python?
In pickling, python module takes Python object as an input and converts
it into string and then using dump function it dumps into file. In unpickling,
it retrieves dumped object from the file.
6] What is PYTHONPATH?
It is an environment variable which you can set to add additional
directories where python will be looking for modules and packages.
7] What are Python Modules?
Python modules contains code which is logically organize. Module makes code easier to understand. A module can define classes, variables and functions.
8] Why Python is Interpreted?
Python is interpreted and as well as complied.It takes Python source code and converts into byte codes which are instructions for CPU. More info here.
9] What is Namespace in Python?
In python, namespace is mapping to the names of objects you have defined.
10] What are Python Decorators?
Decorators is the design pattern in Python. Allows you to modify class or functions behavior without modifying its structure.