#!/usr/bin/python3
# classes.py by Bill Weinman [http://bw.org/]
# This is an exercise file from Python 3 Essential Training on lynda.com
# Copyright 2010 The BearHeart Group, LLC
class Animal:
def talk(self):print('Hey,I am talking')
def walk(self):print('Hey,I am walking')
def clothes(self):print('Hey ,I have nice clothes')
class Duck(Animal):
def __init__(self):
print('constructor')
def quack(self):
print('Quaaack!')
####override
def walk(self):
super().walk()
print('Walks like a duck.')
class Dog(Animal):
pass
def main():
donald = Duck()
donald.walk()
findo=Dog()
findo.talk()
# classes.py by Bill Weinman [http://bw.org/]
# This is an exercise file from Python 3 Essential Training on lynda.com
# Copyright 2010 The BearHeart Group, LLC
class Animal:
def talk(self):print('Hey,I am talking')
def walk(self):print('Hey,I am walking')
def clothes(self):print('Hey ,I have nice clothes')
class Duck(Animal):
def __init__(self):
print('constructor')
def quack(self):
print('Quaaack!')
####override
def walk(self):
super().walk()
print('Walks like a duck.')
class Dog(Animal):
pass
def main():
donald = Duck()
donald.walk()
findo=Dog()
findo.talk()