Why are we using self as first argument?



Why are we using self as first argument?..

Answer / Avneet Kumar Sharma

In Python, methods of classes (i.e., member functions) use `self` as the first parameter to represent the instance of the class that called them. This allows the method to access and modify the object's attributes.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Does python have a switch-case statement?

1 Answers  


How do you use n in python?

1 Answers  


What are the ones that can be used with pandas?

1 Answers  


What are Python decorators?

2 Answers  


What is python shell scripting?

1 Answers  


What is design pattern in python?

1 Answers  


Is there a switch or case statement in python? If not then what is the reason for the same?

1 Answers  


What is python explain the advantages of using python?

1 Answers  


Do you know how is multithreading achieved in python?

1 Answers  


What are the use of tuples in python?

1 Answers  


What is linspace in python?

1 Answers  


Can you count to zero?

1 Answers  


Categories