In [51]:
class ram:
def my(a):
a.name="kumar"
print(a.name)
def m1(a):
print(a.name)
ram1=ram()
ram1.my()
ram1.m1()
#ram.my(ram1)
In [27]:
class ram:
def my(self ):
self.name="kumar"
print(self.name)
age=33
print(age)
def my1(self ):
print(self.name)
print(age)
ram1=ram()
ram1.my()
#ram2=ram()
ram1.my1()
In [26]:
class ram:
def my(self ):
self.name="kumar"
print(self.name)
self.age=33
print(self.age)
def my1(self ):
print(self.name)
print(self.age)
ram1=ram()
ram1.my()
#ram2=ram()
ram1.my1()
No comments:
Post a Comment