loading
# Basic program that creates a class and a method

# create a class called "Person"
class Person:
# Create method "hello"
# Note: must use 'self' in parameter list
def hello(self):
  print "Hello world!"
 
# create object "bob" of class "Person"
bob = Person()

# call method "hello" on object "bob"
bob.hello()

About This Instructable

533views

6favorites

License:

More by matt392:How to Write a Simple Linux Shell Script Extending Lever on Spray Bottle Hand Saw From Wood Shims and Jig Saw Blade 
Add instructable to: