Answers for "self and init 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

Python Answers by Framework

Browse Popular Code Answers by Language