#!/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()
''' 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()
# Import classes from your brans new package from Animals import Mammals from Animals import Birds # Create an object of Mammala class & call a method of it myMammal = Mammals.Mammals() myMammal.printMembers() # Create an object o fBirds class & call a method of it myBird = Birds.Birds() myBird.printMembers()
from Animals import Mammals from Animals import Birds dog = Mammals() dog.printMembers() duck = Birds() duck.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()
def Edit_Mammals(self): EditMammals = Mammals() EditMammals.Read() self.Animals.append(EditMammals)
# Import classes from your brand new package from Animals import Mammals from Animals import Birds Birds.myt() print ('\n') # Create an object of Mammals class & call a method of it myMammal = Mammals.Mammal() myMammal.printMembers() # Create an object of Birds class & call a method of it myBird = Birds.Bird() myBird.printMembers()
from Animals import Mammals from Animals import Birds myMammals = Mammals() myMammals.printmembers() myBirds = Birds() myBirds.printMembers()