Advertisements
Advertisements
प्रश्न
Consider the following class definition:
class Yourclass
marks=10
name= "ABC"
def __init__(self,marks,name):
self.marks=marks
self.name=name
def display(self):
print marks
print name
Give the statement to create an object of class Yourclass.
अति संक्षिप्त उत्तर
Advertisements
उत्तर
YC = Yourclass(10, "ABC")
This passes 10 for marks and "ABC" for name to __init__.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
