Saturday, March 7, 2020

how to write classes in python

class a:
    def __init__(self):
        print("this is initialisation")
    def fn1(self):
        print("this is This is inside fn1")
       
b=a()
b.fn1()


output:
this is initialisation
this is This is inside fn1

No comments:

Post a Comment

python class topic video