Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

classes in python

class Foo:
  def __init__(self):
    self.definition = Foo!
  def hi():
    # Some other code here :)
    
# Classes require an __init__ if you want to assign attributes. (self) defines what describes the attribs.
      
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #classes #python
ADD COMMENT
Topic
Name
5+1 =