We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
Interview Questions-[19-11-2024]
Q.1 What is OOP?
Ans: OOP (Object-Oriented Programming) is a programming paradigm based on the concept of objects, which contain both data (in the form of fields, often called attributes or properties) and code (in the form of procedures, often called methods). It enables developers to model real-world entities and their interactions in a structured and intuitive way.
Q.2 What is Class?
Ans: A class in Python is a blueprint or template used to create objects. It defines the structure and behavior that the objects created from the class will have. A class typically contains attributes (variables) to store data and methods (functions) to define behavior.
Q.3 What is Object?
Ans: An object in Python is an instance of a class. It represents a specific entity created using the blueprint provided by the class. Objects have attributes (to store data) and methods (to perform actions), which are defined in the class.
Q.4 What is Constructor?
Ans: A constructor in Python is a special method used to initialize the attributes of an object when it is created. It is automatically called when an object is instantiated from a class. In Python, the constructor method is defined using the __init__ method.
Q.5 What is self?
Ans: In Python, self is a special keyword used in class methods to refer to the instance of the class that is calling the method. It acts as a reference to the current object, allowing access to the object's attributes and methods.