Python Constructor think differently

md mamunmd mamun
1 min read

What is the actual use of constructor?

class SchoolManagement:

    def __init__(self):
        print("Go to the actual website")

obj=SchoolManagement()

Answer: Generally we are able to know that function is the special method which is called automatically.But we cannot think about what is the actual use of it.

In my opinion constructor use configuration cases.such as database connection,internet connection.whenever we need those functionaliy where user cannot initialize like atm machine initialization.

1
Subscribe to my newsletter

Read articles from md mamun directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

md mamun
md mamun