What is the purpose of "self" in python



What is the purpose of "self" in python..

Answer / Shahzad Alam

In Python, `self` is a reference to the current instance of a class. It is used to access and modify the attributes (variables) and methods of the class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Does python has any command to create variable?

1 Answers  


Explain the difference between local and global namespaces?

1 Answers  


Explain what is the common way for the flask script to work?

1 Answers  


Why is python called python?

1 Answers  


What are the different types of inheritance in Python?

3 Answers  


Which ide is better for python?

1 Answers  


What does the list comprehension do?

1 Answers  


Which is better java or python?

1 Answers  


What is head and tail method for data frames in pandas ?

1 Answers  


What is python unit test?

1 Answers  


Is python string mutable?

1 Answers  


Explain docstring in python?

1 Answers  


Categories