Python Basics6(init method)
class pythonTraining :
def__init__(self,a,b) :
print("my name is tejanth");
self.pen=a;
self.book=b;
def.display(self):
print("my book is "+self.book);
print("my pen is"+self.pen);
#object creation
x=pythontraining('parker','whitenote');
x.dispaly();
y=pythontraining('reynolds','rulenotebook');
y.display();
def__init__(self,a,b) :
print("my name is tejanth");
self.pen=a;
self.book=b;
def.display(self):
print("my book is "+self.book);
print("my pen is"+self.pen);
#object creation
x=pythontraining('parker','whitenote');
x.dispaly();
y=pythontraining('reynolds','rulenotebook');
y.display();
Comments
Post a Comment