#!/usr/bin/env python # Import classes from Animals import Mammals from Animals import Birds # Create mammal myMammal = Mammals() myMammal.printMembers() # Create bird myBird = Birds() myBird.printMembers()
from Animals import Mammals from Animals import Birds mymammal = Mammals() mymammal.printMembers() mybirds = Birds() mybirds.printMembers()
from Animals import Mammals from Animals import Birds dog = Mammals() dog.printMembers() duck = Birds() duck.printMembers()
''' Created on Dec 7, 2015 @author: sanjeev ''' from Animals import Mammals from Animals import Birds myMammal = Mammals() myMammal.printMembers() # Create an object of Birds class & call a method of it myBird = Birds() myBird.printMembers()
# Importing classes from animals package from Animals import Mammals from Animals import Birds from Animals import Reptiles # Creating an object of mammals myMammal = Mammals() myMammal.printMembers() # Creating an object of Birds myBird = Birds() myBird.printMembers() #Creating reptile object myReptile = Reptiles() myReptile.printMembers() #checking to see if we can append to list test1 = Mammals() test1.members.append("Lion") test1.printMembers()