Define a class : Class Definition : Class PYTHON examples


PYTHON examples » Class » Class Definition »

 

Define a class


 
class MyClass:
    "A simple example class"
    i = 12345
    def f(self):
        return 'hello world'

#__doc__ is also a valid attribute, returning the docstring belonging to the class
#"A simple example class".

           
         
  



Leave a Comment / Note


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


PYTHON examples

 Navioo Class
» Class Definition