Saturday, November 16, 2019

a function which is outside the method is called as method

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

python class topic video