class student:
def __init__(self,name,age):
self.name=name
self.age=age
def myfunc(self,a,b):
a=a+b
return a
p1=student("john",23)
print("My names is",p1.name)
d=p1.myfunc(2,3)
print("sum is",d)
No comments:
Post a Comment