QuesAns Print Page – CSKC
Sign In

Search

siteicon
Q&A CBSE12D-2015-B01E #6514

Question:

Find and write the output of the following python code:

class Worker :
    def_init_(self,id,name): #constructor
        self.ID=id
        self.NAME=name
    def Change (self) :
        self.ID=self.ID+10
        self.NAME='Harish'
    def Display(self,ROW) :
        print self.ID,self.NAME,ROW
w=Worker(55,'Fardeen')
w.Display(l)
w.Change( )
w.Display(2)
print w.ID+len(w.NAME)

Answer:

55 Fardeen 1
65 Harish 2
71