My Authors
Read all threads
20 Python Interview Questions & Answers

Prepare yourself for an interview and Go with Confidence👍

A thread🧵💕
1) What is Python? What are the benefits of using Python?

It is a programming language with objects, modules, threads, exceptions and automatic memory mgt. The benefits of pythons are that it is simple and easy, extensible, build-in data structure and it is open-source.
2) What is the difference between list and tuple?

The difference between list and tuple is that list is mutable while tuple is not. Tuple can be hashed for e.g as a key for dictionaries.
3) How are arguments passed by value or by reference?

Everything in Python is an object and all variables hold references to the objects. The references values are according to the functions; as a result, you cannot change the value of the references.
4) What are the built-in types does python provides?

Mutable built-in types
🔶 List
🔷 Sets
🔶 Dictionaries

Immutable built-in types
🔷 Strings
🔶 Tuples
🔷 Numbers
5) What is namespace in Python?

In Python, every name introduced has a place where it lives and can be hooked for. This is known as a namespace. It is like a box where a variable name is mapped to the object placed.
6) What are the tools that help to find bugs or perform static analysis?

PyChecker is a static analysis tool that detects the bugs in Python code and warns about the style and complexity of the bug. Pylint is another tool that verifies whether the module meets the coding std.
7) What are Python decorators?

A Python decorator is a specific change that we make in Python syntax to alter functions easily.
8) What is Dict and List comprehensions are?

They are syntax constructions to ease the creation of a Dictionary or List based on existing iterable.
9) What is lambda in Python?

It is a single expression anonymous function often used as an inline function.
10) Why lambda forms in python do not have statements?

A lambda form in python does not have statements as it is used to make new function object and then return them at runtime.
11) What is a pass in Python?

Pass means, no-operation Python statement, or in other words, it is a place holder in a compound statement, where there should be a blank left and nothing has to be written there.
12) In Python what are iterators?

In Python, iterators are used to iterate a group of elements, containers like a list.
13) What is a unit test in Python?

A unit testing framework in Python is known as a unit test. It supports sharing of setups, automation testing, shutdown code for tests, aggregation of tests into collections etc.
14) In Python what is slicing?

A mechanism to select a range of items from sequence types like list, tuple, strings etc. is known as slicing.
15) What are the generators in Python?

The way of implementing iterators are known as generators. It is a normal function except that it yields expression in the function.
16) What is docstring in Python?

A Python documentation string is known as docstring, it is a way of documenting Python functions, modules and classes.
17) How memory is managed in Python?

i. Python memory is managed by Python private heap space. All Python objects and data structures are located in a private heap. The programmer does not have access to this private heap and interpreter takes care of this Python private heap.
ii. The allocation of Python heap space for Python objects is done by the Python memory manager. The core API gives access to some tools for the programmer to code.
iii. Python also has an inbuilt garbage collector, which recycle all the unused memory and frees the memory and makes it available to the heap space.
18) How Python is interpreted?

Python program runs directly from the source code. It converts the source code that is written by the programmer into an intermediate language, which is again translated into machine language that has to be executed.
19) What is pickling and unpickling?

Pickle module accepts any Python object and converts it into a string representation, this process is called pickling. While the process of retrieving original Python objects from the stored string representation is called unpickling.
20) What is PEP 8?

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

All the best👍
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Trilochan Parida ☁️🚀

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!