Demonstrates a basic class and object : Class Define : Class PYTHON examples


PYTHON examples » Class » Class Define »

 

Demonstrates a basic class and object


Demonstrates a basic class and object

# Demonstrates a basic class and object 

class Critter(object):
    """A virtual pet"""
    def talk(self):
        print "Hi.  I'm an instance of class Critter."

# main
crit = Critter()
crit.talk()



           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Class
» Class Define