Why we use self in python | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

Why we use self in python

I didn't know much about it

10th Sep 2017, 4:09 AM
Ankit
Ankit - avatar
1 Antwort
+ 8
It can be anything, not just 'self' - it's just a convention to use self to be coherent worldwide. Anyhow, the idea is that the first argument of a class instance method, when defining, refers to the particular object itself.
10th Sep 2017, 5:50 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar