

InterviewSolution
Saved Bookmarks
1. |
What will be the output of the following codeclass c (object): ….def_init_(self):self.x = 1 C = C() print C.X print C.X print C.X print C.X |
Answer» All the outputs will be 1, since the value of the objects attribute (X) is never changed. 1 1 1 1 X is now a part of the public members of the class C. Thus it can be accessed directly |
|