Find Interview Questions for Top Companies
Ques:- What is self in Python?
Comments
Admin Feb 2, 2020

The self is an example or an object of a class. In Python, this is explicitly included as the principal parameter. Be that as it may, this isn’t the situation in Java where it’s optional. It separates between the techniques and characteristics of a class with local variables

The self-variable in the init technique refers to the recently made object while in different methods, it refers to the object whose method is called.

Ques:- What is the usage of middlewares in Django?
Right Answer:
Middlewares in Django are used to process requests and responses globally before they reach the view or after the view has processed them. They can be used for tasks such as authentication, logging, session management, and modifying request/response objects.
Ques:- What is the purpose pass statement in python ?
Right Answer:
The `pass` statement in Python is used as a placeholder in situations where syntactically some code is required but you do not want to execute any code. It allows you to create empty functions, classes, or loops without causing an error.
AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users