making constructor in python

Solutions on MaxInterview for making constructor in python by the best coders in the world

showing results for - "making constructor in python"
Manelle
17 Jul 2019
1class User:
2    def __init__(self, user_id, user_name):
3        self.user_id = user_id
4        self.user_name = user_name
5User1 = User(4383,"Empire of programmers")
6print(User1.user_id)
7print(User1.user_name)