class Dog(): def __init__(self,name,team): self.name = name self.teeth ="cannine" self.legs = 4 self.coat = "furry" self.eyes="Pale blue" def barks(self): { print("Bow Wow") } def runs(self): { print("I'm running.") class Husky(Dog): super(Husky,self).__init__self(name,team) self.name = name self.legs = 4 self.team = team self.coat = "double thick" def sled_pull(self): { print("I'm pulling the sled") } def pant(self): { print("I'm panting from sled pulling.") } dog14 = "Husky("White King","Alpha") dog14 = print("Dog14 is ",dog14.name dog14.barks() dog14.name,print("works hard as "),dog14.sled_pull
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question