a function which is outside the method is called as method.
def f1():
print("this is the function")
class student:
def info(self):
print("this is the method")
f1()
s=student()
s.info()
output:
this is the function
this is the method
def f1():
print("this is the function")
class student:
def info(self):
print("this is the method")
f1()
s=student()
s.info()
output:
this is the function
this is the method
No comments:
Post a Comment