Python Tutorial for Beginners 25 - Python __init__ and self in class

In this Python Tutorial for Beginners video I am going to show How to use __init__ method and self self keyword in python. So what does the __init__ method do in python ? __init__ method is used as a constructor for the class. Usually __init__ does some initialization work e.g. initialize attributes and other arguments passed to the class name are given to its __init__() method. It would be incorrect to call __init__ constructor of the __init__ is the closest thing we’re going to get in Python to a constructor. And what is self in python - self is the first argument of every method is a reference to the current instance of the class. self keyword is similar to the keyword this in Java or C . #PythonTutorialforBeginners #ProgrammingKnowledge #LearnPython #Pyth ... #ProgrammingKnowledge #Windows_10 #Python_(Programming_Language) #Python_3.6 #Python #Install_Python #Download # #Programming_Language_(Software_Genre) #Python_Tutorial 20180913 oE_dWWWqxQ0
Back to Top