Saved Bookmarks
| 1. |
Observe the following class definition and answer the question that follows :class info:ips=0def _str_(self): #Function 1return "Welcome to the Info Systems"def _init_(Self):self. _ Sstemdate= " "self. SystemTime = " "def getinput (self):self . Systemdate = raw_input ("enter data")self , SystemTime = raw_Input ("enter data")Info, incrips ()Estaiomethod # Statement 1def incrips ():Info, ips, "times"I = Info ()I. getinput ()Print I. SystemTimePrint I. _Systemdate # Statement 2(i). Write statement to invoke Function 1. (ii). On Executing the above code, Statement 2 is giving an error explain. |
|
Answer» (i). print I (ii). The statement 2 is giving an error because _Systemdate is a private variable and hence cannot to be printed outside the class. |
|