Skip to content

Instantly share code, notes, and snippets.

@brennanbrown
Last active August 5, 2020 17:56
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 brennanbrown/27153818bdeb60fa85c9dd04e1108e74 to your computer and use it in GitHub Desktop.
Save brennanbrown/27153818bdeb60fa85c9dd04e1108e74 to your computer and use it in GitHub Desktop.
class Dog:
species = "canine"
def __init__(self, name):
self.name = name
def greet(self):
print("This dog's name is: ", self.name)
rex = Dog("Rex")
# Class Attribute
rex.species
# Instance Attribute
rex.name
# Defining instance methods
rex.greet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment