Verified.
Thanks for the guidance.
User Profile
Collapse
Profile Sidebar
Collapse
Neeta Singh
Last Activity: Aug 19 '14, 03:24 AM
Joined: Aug 5 '14
Location:
-
_init() not called automatically , when an object is made.
Pls refer to the given below program:
Code:class t2: a=0 def _init_(self): t2.a=10 def f1(self,temp): self.a=temp def f2(self): print self.a O1=t2() O1.f2() O1.f1(1000) O1.f2() O1.a=2000 O1.f2()
0
1000
2000
And when called explicitly :
Code:class t2: a=0
No activity results to display
Show More
Leave a comment: