Answers for "def __init__(self) meaning in python"

3

self and init in python

class Computer:
    def __init__(self):
        self.name= ("Pankaj")
        self.age= 28
c1=Computer()
c2=Computer()
c1.name= "Garg"
print(c1.name)
print(c2.name)
Posted by: Guest on December-26-2020

Code answers related to "def __init__(self) meaning in python"

Python Answers by Framework

Browse Popular Code Answers by Language