Classes in Python

Source code :


class Fruit:
    def Mango():
        print('I am Mango')
        
    def Apple():
        print('I am Apple')
        
Fruit.Mango()
Fruit.Apple()


Output :

I am Mango
I am Apple

Output :


                

Comments :