Python interview questions(Basic)

Here’s a list of questions to note:

1. What is python?
Python is an object-oriented programming language featuring modules, threads, exceptions, and automated memory management.

2. What do you know about PEP 8?
PEP 8 is a coding standard, or collection of recommendations, for writing more understandable Python code.

3. what precisely is lambda in Python?
It is a single-expression unidentified function that is frequently used as an inbuilt function.

4. What is a negative index in Python?
Python sequences can have positive and negative indexes. In the case of a positive index, 0 is the first index, 1 is the second index, and so on. In the case of a negative index, (-1) is the last index, (-2) is the second last index, and so on.

5. What’s the difference between Xrange and range?
Xrange returns the xrange object, whereas range returns the list and utilizes the same memory regardless of range size.