Free Python tutorial for beginners - Python Programming - How to use Classes in Python -Python Class
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 today we are going to see like how to use classes and we have to understand why we need class or work what is the purpose of using this class everything I just explained here let me open idle
now we already seen like uh def function right so we have to write it something like my function and then colon and then print and then test so this is kind of a reusable code I already explained if you use if you just call function then it will run it is just like um reusable functions but but I want to use it like by using by using like oops like object oriented programming Concepts I need to use it for example this is date and time right now if you want to bring use some functionality in this date time then see this you have to try it by using dot if you just type dot it will give you something like this now we have to select whatever we need we have to select it and then we have to print so if you just go Dot it don't show anything okay okay Source here again we have to select because again it has some sub functions so like that we are getting some attributes to use it by using this date and time so it is just kind of a class let's see now I will just um I'll explain like see this you're just typing a equal to 5 like that we can try it and then let's see what it will print so a equal to 5 or equal to 1 I will say like this and then equal to I will just print it three
now if you print
la a DOT
just Clash double underscore this one if you just use it it says like it is a class an integer and if you print it P dot underscore underscore class underscore underscore it is saying that this is the list class so everything it is a class so by using that class only we are just able to achieve something so like this we have to write it we have to create our own classes and then how to use that so that is what we are going to see you today so now you understand right so what is the purpose we are going to create a class now see this class my class colon enter and then you are getting something like date name right so like that I have to use it like my date time okay so my date time equal to I am saying that today dates so 2023 hyphen 0 8 like that it should print just think it right now
this is Sienna okay now let's see this you have to call it class now so instead of import you have to create your own variable for example calling my class equal to my class so instead of import you're using your variable name and then equal to instead of this class you are going to use it your own class my class and then you're going to call it now see this print [Music] my class Dot
see now you are getting like this my date time now if you use this
then enter [Music] you are getting like this so such a way they have created it so if you use this class and then just save print today date then it will print it today that kind of functionality they already written it so you are just importing this class and then you are using it the same like that I just created a class and just by default I'm saying that whenever you are using my date and time you have to get it this one like that is written and functionality so such a way you are able to use this class so this is simple fundamental explains but uh we'll see you in the next class in more detail about how to use def along with this class thank you bye