import animals #Create an object of Mammals class and call a mathod of it myMammal = animals.Mammals() myMammal.printMembers() #Create an object of Birds class and call a mathod of it myBird = animals.Birds() myBird.printMembers() myFish = animals.Fish() myFish.printMembers()
# Import classes from your brand new package #from animals import Mammals #from animals import Birds #import animals # Create an object of Mammals class & call a method of it #myMammal = animals.Mammals() #myMammal.printMembers() # Create an object of Birds class & call a method of it #myBird = animals.Birds() #myBird.printMembers() import animals m = animals.Mammals() m.printMembers() b = animals.Birds() b.printMembers() f = animals.Fish() f.printMembers()
#!/usr/bin/env python # 1a-e # import animals # m = animals.Mammals() # m.printMembers() # b = animals.Birds() # b.printMembers() # f = animals.Fish() # f.printMembers() #1f import animals harmless_birds = animals.harmless.Birds() harmless_birds.printMembers() dangerous_fish = animals.dangerous.Fish() dangerous_fish.printMembers() mammals = animals.Mammals() mammals.printMembers()
import animals ###Brids harmless_brids = animals.Brids() harmless_brids.print_harmless() dangerous_fish = animals.Fish() dangerous_fish.print_dangerous() harmless_mammals = animals.Mammals() harmless_mammals.print_harmless()