Skip to content

Instantly share code, notes, and snippets.

@nerflad
Last active January 18, 2017 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nerflad/a05211e10786f0533a34c0dbdb0503f8 to your computer and use it in GitHub Desktop.
Save nerflad/a05211e10786f0533a34c0dbdb0503f8 to your computer and use it in GitHub Desktop.
Simple example class in Python to demonstrate a constructor to a friend
class Person(object):
alive = True
def __init__(self, name, height):
self.name = name
self.height = height
def sayname(self):
print("Hi, name is ", self.name, " and I am ", self.height, " feet tall!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment