Last active
August 5, 2020 17:56
-
-
Save brennanbrown/27153818bdeb60fa85c9dd04e1108e74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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