Classes and Objects in Python | Python Tutorial - Day #57

preview_player
Показать описание

python, C, C++, Java, JavaScript and Other Cheetsheets [++]:

►Learn in One Video[++]:

►Complete course [playlist]:

Follow Me On Social Media
Comment "#HarryBhai" if you read this 😉😉
Рекомендации по теме
Комментарии
Автор

self ka matlab wo object jiske liye koi method call kia ja raha hai i.e
[self parameter is an reference to the current instance of the class and is used to access variables that belong to the class]

tatyavinchu
Автор

The self parameter is a reference to current instance of the class. It is used to access the variables that belongs to the class.

Srinivasssssss
Автор

This will be good for vs users:-

# A class is a blueprint or a template for creating objects, providing initial values for state (member variables or attributes), and implementations of behavior (member functions or methods). The user-defined objects are created using the class keyword.


class info:
name = "ganesh"
age = 17

print(info()) #We cant print the matter inside the class like this or without bracket.

#We can print the info present in the class like this:-
print(info.name)
print(info.age)


# Creating an Object:
# Object is the instance of the class used to access the properties of the class Now lets create an object of the class:-

a = info()
print(a.name)
print(a.age)

# changing the object:-

b = info()
b.name = 'Rohan'
b.age = 18

print(b.name)
print(b.age)


# Self Parameter:-

# The self parameter is a reference to the current instance of the class, and is used to access variables that belongs to the class.

# It must be provided as the extra parameter inside the method definition.


class person:
name = "Enter your name"
age = "Enter your age"
def intro(self):
print(f"My name is {self.name} iam {self.age} years old.")


c = person()
c.name = 'Ganesh'
c.age = 17

d = person()
d.name = 'Rohan'
d.age = 18

c.intro()
d.intro()

SaiGaneshPulijala
Автор

self means - it's the current instance of the class and is used to access variables that belongs to that class. thanks for clearing my doubts

bholegaming
Автор

Self parameter is used to refer to the the current instance of the class or the object for which the method is called.

ritvikvoleti
Автор

self ka matlab vo object jiske liye koye method call kiya hai -->
self parameter is an reference to the current instance of the class and used to access variable that belongs to the class

arjunpawar
Автор

The meaning of self :-
The self parameter is a reference to the current instance of the class, and is used to access variables that belongs to the class.

sumithivale
Автор

Self parameter is a reference to the current instance of class and is used to access variables that belong to that class. (Self ka matlab woh object jis ke liye koi method call kia ja raha hai)

svk
Автор

the self parameter us a reference to the current instance of the class, and is used to access variable that belongs to the class
it must be provided as the extra parameter inside the method definition

radhesyambeats..
Автор

Self is a reference to the current instance of the class and is use to access variable that belong to the particular class.

shubhamacharya
Автор

Self parameter is "Vo wala object jiske liye method call kiya ja raha hai". Writing in hindi to remember more efficiently :)

abhaypatil
Автор

self jo use kry ghy function wo usy class ky object ko refer kry ghy like class Students and with student_info() then a.student_info() jb kry ghy agr to self a ko refer kry gha agr a mei koi object banaya ho gha to wo aa jhy gha self mei werna by default jo class mei diya hai wo utha ky gha

smilekr
Автор

I took data science course from PW skills, but i am learning from here and I understand better. Thanks harry bhai.. ❤❤❤

rishabhpandey
Автор

Self parameter is a reference to the current instance of the class, and is used to access variables that belongs to the class

balajir
Автор

self parameter is a reference to a class which is used to access the variables belonging to that class

SaiGaneshPulijala
Автор

self parameter is used to refer to the current instance of class or object for which the method is called

Funny_videos-h
Автор

self parameter is a ref to the current instance of the class, and is used to access variables that belong to that class

Gaurav-wmlm
Автор

Day #57 done. The self parameter is used as an extra parameter inside the called class

mariamhasan
Автор

Please after the this 100 days series please make dart programming playlist 😔

alakhmanipriya
Автор

self matlab referring to the object for which that class method is being called. Thanks Harry Bhai, I tried lots of documents and videos to understand this self, but you have explained it in a best possible way.

eqzdkjq