예제 #1
0
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()
예제 #2
0
# 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()

예제 #3
0
#!/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()
예제 #4
0
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()