1. class Mine:
2. def fun1(self,x):
3. self.x=x
4. print "Inside fun1",self.x
5. def fun2(self):
6. print "Inside fun2 :",self.x
7.
8. obj1 = Mine()
9. obj1.fun1(1)
10. obj1.fun2()
11. obj2 = Mine()
12. obj2.fun1(10000)
13. obj2.fun2()
14. del obj1.x
15. #obj1.fun2()
16. obj2.fun2()
17. Mine.a=111
18. obj3=Mine()
19. print "Mine.a: ",Mine.a
20. print "obj1.a: ",obj1.a
21. print "obj2.a: ",obj2.a
22. print "obj2.a: ",obj3.a
23. obj2.c=222
24. #print "\nMine.c: ",Mine.c
25. #print "obj1.c: ",obj1.c
26. print "obj2.c: ",obj2.c
27. #print "obj2.c: ",obj3.c
Can someone please help me to understand what is happening at line number 17 and 23, and why the code on line number 19,20,21,22 is working fine and code on line number 24, 25, 27 is giving error ?
Thanks in Advance.