Created
December 4, 2018 16:38
-
-
Save ty-shaikh/4b21ad99757da06a29915101b49fcceb to your computer and use it in GitHub Desktop.
Programming Paradigm - OOP
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
# OOP | |
class Animal: | |
def __init__(self, name): | |
self.name = name | |
class Parrot(Animal): | |
def talk(self): | |
print self.name + ‘ want a cracker!’ | |
Fido = Animal(‘Fido’) | |
Polly = Bird(‘Polly’) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment