Python tutorial - Python Class and object - How to use Class and object Instantiating in Python

Опубликовано: 28 Июнь 2026
на канале: KeeshtuTechnology
8
0

Free Python tutorial for beginners-Python Programming-How to use Class and object - Instantiating it
Subscribe Here -https://www.youtube.com/@KeeshtuTechn...

#python#pythonprogramming #pythontutorial #pythonforbeginners #pythonclass #youtubechannel #pythoninstallationcomplete #pythonhowtoinstall #pythoninstall #pythondownload #pythontutorialfree #pythonyoutube #pythonenglish #pythonenglish #pythonexecvseval #pythonexec()vseval() #pythonexec() #pythoneval() #youtubeviews #pythondef #pythondef() #pythonfunctions #pythonbreak #pythoncontinue #pythonpass #pythonzip #pythonunzip #pythonprintescapecharacter #pythonrepr() #pythonr
Please Captions on - Python in English, Python in Tamil, Python in Telugu, Python in Malayalam, Python in Chinese, Python in Japanese, Python in German, Python in Hindi, Python in French, Python full course for beginners

welcome to technology platform so earlier we have seen like how to create class so what is the fundamental we are using the thing the things we have seen in now I want to show you like how to use Dev inside the class and then how instantiating a class let me open idle now okay so in the previous class you have seen like this so creating a class

and then you just call creating an object and calling this class and then printing by using my class Dot and then you are calling this variable then it should display what we written here this is what we've seen in the earlier class now how to use def inside this class we have to see it now see this you're going to use it class my class and then you are going to write def my function Open Bracket close bracket it should return an error message I will show you why and then I will Rectify that now enter print

now you can say like my date time

that's it now enter close the class has been created now if you call this class this will throw an error message I'll show you

let's see this my class and then you are going to print

Dot you will get two one is attribute another one is like a function now if you call this and then click like this now let's see this

so it is throwing an error message my date time not okay sorry not my date time it's okay correct so my date time only it's something throwing an error message because we are calling a class as a Constructor so if you call like this we are not writing anything simply Open Bracket close bracket and my class

for this kind of class we have to use some special thing that is called self we have to use self as compulsory let's see now you're going to create a class

here Dev function you're using it right here you need to use it self and then you have to use it self Dot my date time you're going to chord like this that's it now again same thing you have to create a call a class so you can use it your own variable calling my classes like this and then my class Open Bracket and then print and then this one oh I just used wrongly that is what creating an error message let me show you one more time [Music]

Dot and then my function

and then enter so it is written 2023 hyphen 08 so I will create one more time without self so earlier I just created a it's calling some wrong functions I used remove this I used like this then calling my class and then I'm going to call like this without self now see this takes zero positional argument but one was given so this is what we always have to use it self function so now if you use this kind of things the same thing but you are going to pass itself and self dot my date and time you are going to call it and then you can call both attribute as well as function let's see I will show you that print

column make classes Dot directly I can call this variable

2023.08 instead of that I can call this function as well Dot

my function my function you have to use it open bracket close back and then enter so it is returning 2023.08 and none but why why it is something returning and means we are not returning anything here so because of that you are getting like this I will show you so why this is creating an unmins by default we are not returning anything now let's see so here I'll say like return

completed like that I'll say something

now I'll call the same thing foreign

something so because of that you are getting none but we used to do something like this because of that it has been disappeared see you in the next classes with more some interesting topics