Blog

Blog
Blog

Predict the output of the following code :

Predict the output of the following code :class Match:‘ “Runs and Wickets” ‘runs=281wickets=5def init(self,runs,wickets):self.runs=runsself.wickets=wicketsprint ” Runs scored are : ” ,runsprint “Wickets taken are : ” ,wicketsprint “Test.do:” , Match.docprint “Test.name:” , Match.nameprint “Test.module:” , Match.moduleprint “Test.bases:” , Match.basesprint “Test.dict:” , Match.dict Answer If Answer Not Available Please comment if you Know answer

In the code of Q-13 what will be output if the following command is given: (Assuming YC is the object) YC.display()

In the code of Q-13 what will be output if the following command is given: (Assuming YC is the object) YC.display() Answer If Answer Not Available Please comment if you Know answer

Give the statement to a. Check whether the attribute str exists in the class Test whose object is T1 b. Assign a value “Hello” to the attribute str of class Test and object T1.

Give the statement toa. Check whether the attribute str exists in the class Test whose object is T1b. Assign a value “Hello” to the attribute str of class Test and object T1. Answer If Answer Not Available Please comment if you Know answer

Name the methods that can be used to a. access attribute of an object b. delete an attribute of an object

Name the methods that can be used toa. access attribute of an objectb. delete an attribute of an object Answer If Answer Not Available Please comment if you Know answer

If we want to make the method that is added dynamically to a class available to all the instances of the class, how can it be done? Explain with the help of an example.

If we want to make the method that is added dynamically to a class available to all the instances of theclass, how can it be done? Explain with the help of an example. Answer If Answer Not Available Please comment if you Know answer

Differentiate between reference counting and automatic garbage collection with respect to Python

Differentiate between reference counting and automatic garbage collection with respect to Python Answer If Answer Not Available Please comment if you Know answer

What do you mean by name mangling? Support your answer with relevant example.

What do you mean by name mangling? Support your answer with relevant example. Answer If Answer Not Available Please comment if you Know answer

Explain __str__ with an example.

Explain str with an example. Answer If Answer Not Available Please comment if you Know answer

Differentiate between class attributes and instance attributes

Differentiate between class attributes and instance attributes Answer If Answer Not Available Please comment if you Know answer

Explain the importance of self in Python classes.

Explain the importance of self in Python classes. Answer If Answer Not Available Please comment if you Know answer