codeGK
Code it ALL
__init__() function in Python - CodeGK

♦ __init__() function in Python

♣ Example3: __init__() function in Python

__init__() is a Class defined function, which is always executed when an instance of the Class Object is initiated.
The __init__() function can be used to assign values to object properties.
Example
Input:
Output: