Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (2.2k points)

Could someone tell me what does self mean in Python?

1 Answer

0 votes
by (3.9k points)

The “self” parameter when used inside the class, refers to the current instance of the class, and thereby helps in accessing variables that belongs to the same class. The important thing to remember is that you don’t need to write “self” if you like you could write anything in the place of “self”, but the one thing you should keep in mind is that it has to be the first parameter, of any function in the class.

Wish to learn Python and validate your coding skill through a certification? Come and check out the Python certification course from Intellipaat, which offers you industry-standard training courses and guided projects to help you in building practical skills. Take a look at our YouTube video on Python for Beginners from our subject-matter experts.

Related questions

0 votes
1 answer
asked Jan 21, 2020 in Python by Rajesh Malhotra (19.9k points)
0 votes
1 answer
asked Feb 4, 2021 in Python by Rekha (2.2k points)
0 votes
1 answer
asked Dec 16, 2020 in Python by ashely (50.2k points)
0 votes
1 answer
0 votes
1 answer
asked Dec 6, 2020 in Python by ashely (50.2k points)

Browse Categories

...