def main(): castle_pets = PettingZoo("Castle Pets", "fuzzy little critters to pet") # shrek_swamp = wetlands("Shrek's Swamp", "this is my swamp") # sneaky_snakies = snakePit("Sneaky Snakes", "bring a recorder and they'll dance for you") # donkey = Donkey("Donkey", "donkey", "morning", "grass", 123) # slithers = Snake("Slithers", "python", "mice", 456) # nemo = Fish("Nemo", "clown fish", "pellets", 789) carol = Tiger("Carol", "Bengal", "husband\'s", 741) # castle_pets.animals.append(carol) # sneaky_snakies.animals.append(slithers) # shrek_swamp.animals.append(nemo) castle_pets.add_animal_pythonic(carol) carol.run() carol.swim()
def main(): varmint_village = PettingZoo("The Varmint Village", "critters that love to be pet!") # remember, some animals may require more arguments than others; e.g. shift dolly = Elephant("Dolly", "miniature llama", "morning", "hay", 1033) snappy = Dolphin("Snappy", "American Alligator", "afternoon", "fish", 1044) varmint_village.add_animal(dolly) varmint_village.add_animal(snappy)
def main(): varmint_village = PettingZoo("Varmint Village", "cute and fuzzy critters to cuddle") slither_inn = SnakePit('Slither Inn', "stupendous snakes of all sizes") bubbling_brook = Wetlands('Bubbling Brook', "feathery and wet critters") dolly = Llama("Dolly", "miniature llama", "morning", "hay", 1033) snappy = RattleSnake("Snappy", "American RattleSnake", "frogs", 1044) donald = Duck("Donald", "Animated Duck", "Duck Food", 123) varmint_village.add_animal_pythonic(dolly) varmint_village.add_animal_pythonic(snappy) slither_inn.add_animal_pythonic(dolly) slither_inn.add_animal_pythonic(snappy) bubbling_brook.add_animal_pythonic(donald) bubbling_brook.add_animal_pythonic(snappy)
from slithering import Rattlesnake, Copperhead from walking import Billygoat, Sloth, Cougar from attractions import PettingZoo, SnakePit, Wetlands from animals import Conrad Ronnie = Rattlesnake("Ronnie", "Rattleman", "Morning Noon and Night", "Crickets I think") Coolio = Copperhead("Coolio", "Copperhead", "Late at night", "little childrens' ankles") Camila = Cougar("Camilla", "Cougar", "Whenever there's FRESH BLOOD", "Those young studs") SlitherInn = SnakePit("Slither Inn") CritterTown = PettingZoo("Critter Town") SlitherInn.animals.append(Ronnie) SlitherInn.animals.append(Coolio) CritterTown.animals.append(Conrad) print(SlitherInn) print(CritterTown)
from slithering import (Snake, Snail, Leech, Worm, Salamander) from swimming import (Fish, Seal, Shark, Eel, Turtle) from walking import (Llama, Donkey, Goat, Horse, Chicken) from attractions import (PettingZoo, CritterCove, Terrarium) # Walking new_llama = Llama("Lenny", "Llama", "Morning", "llama food") new_donkey = Donkey("Dave", "Donkey", "Morning", "donkey food") new_goat = Goat("Glenda", "Goat", "Midday", "goat food") new_horse = Horse("Harriet", "Horse", "Midday", "horse food") new_chicken = Chicken("Chester", "Chicken", "Afternoon", "chicken food") petting_zoo = PettingZoo("Varmint House", "Where walking animals are") petting_zoo.add_to_petting_zoo(new_llama) petting_zoo.add_to_petting_zoo(new_donkey) petting_zoo.add_to_petting_zoo(new_horse) petting_zoo.add_to_petting_zoo(new_goat) petting_zoo.add_to_petting_zoo(new_chicken) print(f'In the {petting_zoo.attraction_name} {petting_zoo.description}, we have:') for animal in petting_zoo.animals: print(f'{animal}') # Slithering new_snake = Snake("Sandy", "Snake", "snake food") new_snail = Snail("Susan", "Snail", "snail food") new_leech = Leech("Laura","Leech", "leech food") new_worm = Worm("Wanda", "Worm", "worm food") new_salamander = Salamander("Sal", "Salamander", "salamander food") new_cove = CritterCove("Critter Cove", "where the swimming animals live")
from animals import Carp, Catfish, Copperhead, CoralSnake, Cottonmouth, Crocodile, Donkey, Goat, Llama, Monkey, Python, RattleSnake, Seal, Tiger, Turtle from attractions import PettingZoo, SnakePit, Wetlands # Naming attractions varmint_village = PettingZoo('Varmint Village') the_slither_inn = SnakePit('The Slither Inn') critter_cove = Wetlands('Critter Cove') # Naming animals and adding them to Petting Zoo mizz_fuzz = Llama("Miss Fuzz", "domestic llama", "morning", "llama chow", 34) billy = Goat("Billy", "american pygmy", "midday", "goat chow", 12) tony = Tiger("Tony", "bengal tiger", "midday", "tiger chow", 32) george = Monkey("George", "spider monkey", "night", "monkey chow", 23) geoff = Donkey("Geoff", "donkey", "night", "donkey chow", 14) varmint_village.add(mizz_fuzz) varmint_village.add(billy) varmint_village.add(tony) varmint_village.add(george) varmint_village.add(geoff) # Naming animals and adding them to Wetlands bruce = Turtle("Bruce", "turtle", "turtle chow", 65) croc = Crocodile("Croc", "crocodile", "fish chow", 66) willy = Catfish("Willy", "blue catfish", "fish chow", 67) lucile = Seal("Lucile", "seal", "fish chow", 68) big_mouth = Carp("Big Mouth", "asian carp", "fish chow", 69) critter_cove.add(bruce) critter_cove.add(croc) critter_cove.add(willy) critter_cove.add(lucile) critter_cove.add(big_mouth)
critter_cove.add_animals(quackers) critter_cove.add_animals(goldeen) critter_cove.add_animals(odette) critter_cove.add_animals(jinli) slither_inn = SnakePit("Slither Inn", "more snakes than an Indiana Jones movie ") slither_inn.add_animals(snakey) slither_inn.add_animals(mister_cobra) slither_inn.add_animals(monty) slither_inn.add_animals(b_sizzle) slither_inn.add_animals(chip) varmint_village = PettingZoo( "Varmint Village", "a petting zoo filled with your favorite animals") varmint_village.add_animals(kuzco) varmint_village.add_animals(shrek) varmint_village.add_animals(googles) print("last critter function", varmint_village.last_critter_added) for animal in varmint_village.animals: print( f'You can find {animal.name} the {animal.species} in {varmint_village.attraction_name}' ) for animal in slither_inn.animals: print( f'You can find {animal.name} the {animal.species} in {slither_inn.attraction_name}'
from animals import Llama, Goat, Alpaca, Pony, Pig, Tadpole, Goldfish, Mallard, Goose, Frog, Snake, Turtle, Lizard, Viper, Boa from attractions import PettingZoo, Wetlands, SnakePit varmint_village = PettingZoo("The Varmint Village") # remember, some animals may require more arguments than others; e.g. shift dolly = Llama("Dolly", "miniature llama","morning", "hay") snappy = Goldfish("Snappy", "American Alligator", "afternoon", "fish") varmint_village.add_animal_pythonic(dolly) varmint_village.add_animal_type_check(dolly) varmint_village.add_animal_pythonic(snappy) # fluffy_village = PettingZoo("Fluffy Village") # varmint_village = PettingZoo("Varmint Village") # wet_village = Wetlands("Wet Village") # print(wet_village.description) ############ miss_fuzz = Llama("Miss Fuzz", "domestic llama", "morning", "Llama Chow" ) mr_fuzz = Goat("Mister Fuzz", "mountain goat", "morning", "Goat Chow")
lucy = Diamondback("Lucy", "diamondback", "cashews", 2) donkeh = Donkey("Donkeh", "donkey", "morning", "waffles", 3) fsh = Fish_With_No_Eyes("Fsh", "fish with no eyes", "carrots", 4) g****e = Goat("G****e", "goat", "afternoon", "goat snacks", 5) silver = Goldfish("Silver", "goldfish", "Goldfish", 6) euryale = Gorgon("Euryale", "gorgon", "gorgonzola", 7) mav = Goose("Mav", "Canada goose", "watercress sandwiches", 16) peanut_butter = Jellyfish("Peanut Butter", "jellyfish", "sandwiches", 8) miss_fuzz = Llama("Miss Fuzz", "llama", "evening", "llamagranates", 9) mallory = Mallard("Mallory", "mallard", "mallort", 10) tang = Orangutan("Tang", "orangutan", "midnight", "Tang", 11) snat_rake = Rat_Snake("Snat Rake", "rat snake", "Rat Snacks(TM)", 12) maracas = Rattlesnake("Maracas", "rattlesnake", "rattlesnacks", 13) jaws = Shark("Jaws", "shark", "bigger boats", 14) little_sebastian = Small_Horse("Little Sebastian", "small horse", "sunrise", "hay-zelnuts", 15) varmint_village = PettingZoo("Varmint Village", "cute and fuzzy critters to cuddle") snake_hole = SnakePit("The Snake Hole", "unlovable and slithery critters to avoid") soggy_bottoms = Wetlands("Soggy Bottoms", "wet and wild critters in your area") varmint_village.add([donkeh, g****e, miss_fuzz, tang, little_sebastian]) snake_hole.add([steve_url, lucy, euryale, snat_rake, maracas]) soggy_bottoms.add([fsh, silver, peanut_butter, mallory, jaws]) varmint_village.add_animal_type_check(mav) for animal in varmint_village.animals: print(animal)
from animals import Goat, Goose, Llama, Shark, Pig, Snake from attractions import PettingZoo bob = Goose("Bob", "Canada goose", "watercress sandwiches", 243234) bob.run() bob.swim() snappy = Shark("Snappy", "Great White", "Fingers", 2342352) varmint_village = PettingZoo("Varmint Village", "critters that like to dig and scurry") varmint_village.add_animal(bob) varmint_village.add_animal(snappy) print(varmint_village) for animal in varmint_village.animals: print(animal)
steve = Stingray("Steve", "stingray", "food", "midday", 6785) alex = Skink("Alex", "skink", "insects", "afternoon", 6780) greg = Gecko("Greg", "gecko", "insects", "afternoon", 27382) mary = Iguana("Mary", "iguana", "insects", "morning", 123772) bob = Boa("Bob", "boa", "midday", "insects", 17238) gabe = Cornsnake("Gabe", "corn snake", "insects", "midday", 9372) print(gabe) varmint_village = PettingZoo("Varmint Village", "cuddly creatures") varmint_village.animals.append(miss_fuzz) varmint_village.animals.append(wilbur) varmint_village.animals.append(eeyore) varmint_village.animals.append(bugs) varmint_village.animals.append(bonnie) slither_inn = SnakePit("Slither Inn", "slithery creatures") slither_inn.animals.append(alex) slither_inn.animals.append(greg) slither_inn.animals.append(mary) # slither_inn.animals.append(bob) slither_inn.animals.append(gabe) critter_cove = Wetlands("Critter Cove", "waterbound buddies") critter_cove.animals.append(tim)
para = Ox(5, "Para 'D' Ox", "domestic ox", "midday", "ox chow") # goose = Goose(16, "Goose the Goose", "domestic goose", "goose chow") dude = SeaTurtle(6, "Dude", "domestic sea turtle") shocky = Eel(7, "Shocky", "domestic eel") towel = Dolphin(8, "Towel", "domestic dolphin") finn = Shark(9, "Finn", "domestic shark") boo = Whale(10,"Boo You Whale", "domestic whale") cheese = Ratsnake(11, "Cheese", "domestic ratsnake") bronze = Copperhead(12, "Bronze", "domestic copperhead") monty = Python(13, "Monty", "domestic python") shake = Rattlesnake(14,"Shake", "domestic rattlesnake") louis = Kingsnake(15, "King Louis", "domestic kingsnake") varmint_village = PettingZoo("Varmint Village", "cute and fuzzy critters to cuddle") pit_of_doom = SnakePit("Pit of Doom", "cute and scaley critters") waterworld = Wetlands("Waterworld", "cute and wet critters") varmint_village.add_animal(mama) varmint_village.add_animal(billy) varmint_village.add_animal(waffles) varmint_village.add_animal(chris) varmint_village.add_animal(para) # varmint_village.add_animal(goose) pit_of_doom.add_animal(cheese) pit_of_doom.add_animal(bronze) pit_of_doom.add_animal(monty) pit_of_doom.add_animal(shake) pit_of_doom.add_animal(louis)
#slithering🐍 sam = Garden_Snake("Sam", "Garden Snake", "tomatoes", "bugs", 987) errol = Earthworm("Errol", "Earthworm", "fertilizer", "dirt", 654) sal = Salamander("Sal", "Salamander", "flies", "bugs", 321) pippin = Python_Snake("Pippin", "Python Snake", "mouse","mice", 000) bruce = Boa_Snake("Bruce", "Boa Snake", "mouse", "rats", 54654) #swimming🐠 nemo = Fish("Nemo", "Fish", "morning", "plankton", 101010) alan = Alligator("Alan", "Alligator","afternoon", "steak", 788789) cedric = Seahorse("Cedric", "Seahorse", "afternoon", "plankton", 555666) fred = Frog("Fred", "Frog", "morning", "flies", 789321) pedro = Platypus("Pedro", "Platypus", "morning", "gummie bears", 5556666555) varmint_village = PettingZoo("Varmint Village", "cute and fuzzy critters to cuddle") slither_inn = SnakePit("Slither Inn", "sleek and slithering creatures all around you") critter_cove = Wetlands("Critter Cove", "If it swims and can be caught, it's in here") varmint_village.add_animal(june) varmint_village.add_animal(johnny) varmint_village.add_animal(alan) slither_inn.add_animal(sam) slither_inn.add_animal(errol) slither_inn.add_animal(sal) slither_inn.add_animal(pippin) slither_inn.add_animal(bruce) critter_cove.add_animal(nemo) critter_cove.add_animal(alan)
def main(): petting_zoo = PettingZoo('Petting Zoo', 'Pet Pet Pet') snakepit = Snakepit("Creepy Crawlers", "Keep your hands outside of the tanks") aquarium = Wetlands("Awesome Aquatics", "Sharks, Whales, and Tunas Oh MY") miss_fuzz = Llama("Miss Fuzz", "Domestic Llama", "Morning", "Grass", 92549) george = Monkey("George", "Howler Monkey", "Afternoon", "Bananas", 39181) gregory = Giraffe("Gregory", "Spotted Giraffe", "Midday", "Carrots", 76876) donnie = Donkey("Donnie", "Catalan Donkey", "Morning", "Hay", 23648) helen = Horse("Helen", "Arabian Horse", "Afternoon", "Apples", 54921) randy = Rattlesnake("Randy", "Texas Rattlesnake", "Mice", 81625) mary = Mamba("Mary", "Black Mamba", "Gerbils", 71603) vinnie = Viper("Vinnie", "Viper", "Lizzards", 49816) kerry = Kingsnake("Kerry", "King Snake", "Turtle Eggs", 19254) carlos = Cobra("Carlos", "King Cobra", "Hamster", 12345) debra = Dolphin("Debra", "Striped Dolphin", "Squids", 5678) walker = Whale("Walker", "Killer Whale", "Penguins", 41376) sarah = Shark("Sarah", "Great White Shark", "Seals", 59175) gary = Goldfish("Gary", "Lionhead Goldfish", "Fish Food", 28922) tina = Tuna("Tina", "Blackfin Tuna", "Shrimp", 43819) petting_zoo.append_animal(miss_fuzz) petting_zoo.append_animal(george) petting_zoo.append_animal(gregory) petting_zoo.append_animal(donnie) petting_zoo.append_animal(helen) petting_zoo.append_animal(debra) # Will Not Append. snakepit.append_animal(randy) snakepit.append_animal(mary) snakepit.append_animal(vinnie) snakepit.append_animal(kerry) snakepit.append_animal(carlos) snakepit.append_animal(helen) # Will Not Append. aquarium.append_animal(debra) aquarium.append_animal(walker) aquarium.append_animal(sarah) aquarium.append_animal(gary) aquarium.append_animal(tina) aquarium.append_animal(randy) # Will Not Append. for animal in petting_zoo.animals: print( f'You can find {animal.name} the {animal.species} in {petting_zoo.name}' ) for animal in snakepit.animals: print( f'You can find {animal.name} the {animal.species} in {snakepit.name}' ) for animal in aquarium.animals: print( f"You can find {animal.name} the {animal.species} in {aquarium.name}" ) donnie.chipnum = 12334 print(donnie.chipnum) print(aquarium.last_critter_added) print(carlos) donnie.feed() randy.feed() sarah.feed() sarah.swim()
print(JabberJaws) JabberJaws.feed() Mechazilla = Godzilla("Mechazilla", "Robot", "a cold fusion reactor", 15) print(Mechazilla) Mechazilla.feed() def report_animals_by_attractions(*attractions): for attraction in attractions: print(f'{attraction.attraction_name} is where you can find {attraction.description} ') for animal in attraction.animals: print(f'* {animal.name} the {animal.species}.') varmint_village = PettingZoo("Varmint Village") varmint_village.animals.extend([Bartholomew, Lassie, Fluffy, Beaudreaux, Tank]) for animal in varmint_village.animals: print(f'You can find {animal.name} the {animal.species} in {varmint_village.attraction_name}.') slither_inn = SnakePit("Slither Inn") slither_inn.animals.extend([Toby, Bitey, Karen, Kaa, Dipper]) for animal in slither_inn.animals: print(f'You can find {animal.name} the {animal.species} in {slither_inn.attraction_name}.') danger_bay = WetLands("Danger Bay") danger_bay.animals.extend([Wally, Cuddles, JabberJaws, Pickles, Mechazilla]) for animal in danger_bay.animals: print(f'You can find {animal.name} the {animal.species} in {danger_bay.attraction_name}.')
from animals import Copperhead, Coralsnake, Coy, Donkey, Duck from animals import Frog, Goat, Goldfish, Goose, Horse, Llama from animals import Moccassin, Python, Ratsnake, Sheep from attractions import Wetlands, SnakePit, PettingZoo varmint_village = PettingZoo("Varmint Village", "cute and fuzzy critters to cuddle") slither_inn = SnakePit("Slither Inn", "slithering snakes and creepy crawlies") critter_cove = Wetlands("Critter Cove", "fins and feathers in all colors") miss_fuzz = Llama('Miss Fuzz', 'domestic llama', 'morning', 'grass', 12345) hee_haw = Donkey('Hee Haw', 'mountain donkey', 'midday', 'apples', 908790) satan = Goat('Satan', 'pygmy goat', 'afternoon', 'grass', 8654675) perm = Sheep('Perm', 'curly sheep', 'morning', 'grass', 837594) ed = Horse('Mr. Ed', 'Tennessee walking horse', 'midday', 'oats', 957983) cuddles = Ratsnake('Cuddles', 'Ratsnake', 'mice', 87676) kissy = Copperhead('Kissy', 'Copperhead', 'mice', 4657) monty = Python('Monty', 'python', 'rats', 665679) cotton = Moccassin('Cotton', 'cotton mouth', 'frogs', 356554) rainbow = Coralsnake('Rainbow', 'coral snake', 'roaches', 108375) tangerine = Goldfish('Tangerine', 'goldfish', 'fish flakes', 23987) waddle = Duck('Waddle', 'mallard', 'corn kernels', 487589) ki = Coy('Ki', 'coy', 'fish flakes', 87984) ribbit = Frog('Ribbit', 'bull frog', 'flies', 58769) the_devil = Goose('The Devil', 'goose', 'corn kernels', 63495) varmint_village.add(miss_fuzz) varmint_village.add(hee_haw) varmint_village.add(satan) varmint_village.add(perm) varmint_village.add(ed)
tony = Tiger("Tony", "hungry tiger", "morning", "cat food", 234) ned = Giraffe("Ned", "friendly giraffe", "evening", "leaves", 987) henry = Hippo("Henry", "hippopotamus", "afternoon", "cereal", 856) george = Monkey("George", "chimpanzee", "morning", "banana", 527) flipper = Dolphin("Flipper", "wild dolphin", "afternoon", "plants", 2345) buddha = Starfish("Buddha", "golden starfish", "morning", "fish food", 6723) ed = Eel("Ed", "electric eel", "evening", "algae", 8976234) gus = Octopus("Gus", "wild octopus", "evening", "pond scum", 9087234) jerry = Goldfish("Jerry", "wild octopus", "morning", "fish food", 9873) carl = Copperhead("Carl", "copperhead snake", "morning", "mice", 987234) ren = Rat_Snake("Ren", "poisonous rattler", "afternoon", "mice", 234345) sally = Salamander("Sally", "domestic salamander", "afternoon", "plants", 1) charlie = Snail("Charile", "domestic snail", "afternoon", "bugs", 7) al = Alligator("Al", "dangerous gator", "afternoon", "anything", 43) varmint_village = PettingZoo("Varmint Village") slither_inn = SnakePit("Slither Inn") water_town = Wetlands("Water Town") slither_inn.add_animal(carl) slither_inn.add_animal(ren) slither_inn.add_animal(sally) slither_inn.add_animal(charlie) slither_inn.add_animal(al) varmint_village.add_animal(miss_fuzz) varmint_village.add_animal(tony) varmint_village.add_animal(ned) varmint_village.add_animal(henry) varmint_village.add_animal(george) water_town.add_animal(flipper) water_town.add_animal(buddha)
tuxedo = Penguin("Tuxedo", "formal cutie", "baby fish", 77843) print(tuxedo) tuxedo.feed() def report_animals_by_attractions(*attractions): for attraction in attractions: print( f'{attraction.attraction_name} is where you can find {attraction.description} like:' ) for animal in attraction.animals: print(f'* {animal.name} the {animal.species}.') varmint_village = PettingZoo("Varmint Village", "cute and fuzzy critters to cuddle!") varmint_village.animals.extend([bugs, miss_fuzz, fuzz_butt, rufus, jerkface]) for animal in varmint_village.animals: print( f'You can find {animal.name} the {animal.species} in {varmint_village.attraction_name}.' ) print(varmint_village.last_critter_added) # varmint_village.add_animal(bob) # for animal in varmint_village.animals: # print(animal) slither_inn = ReptileHouse("Slither Inn", "snakes and slimy things of all sizes") slither_inn.animals.extend([eek, heckno, becoming, tiny, gross]) for animal in slither_inn.animals: print(
jenny = Donkey('Jenny', 'donkey', 'midnight', 'manflesh', 1337) penny = Llama('Penny', 'llama', 'dusk', 'manflesh', 808) benny = Frog('Benny', 'frog', 'manflesh', 8675309) lenny = Goat('Lenny', 'goat', 'dusk', 'manflesh', 123) vinny = Snake('Vinny', 'snake', 'mouseflesh', 324) connie = Duck('Connie', 'duck', 'dawn', 'gooseflesh', 909) johnny = Fish('Johnny', 'fish', 'fishflesh', 9) ronnie = Bull('Ronnie', 'bull', 'midnight', 'manflesh', 1011) lonny = Pigeon('Lonny', 'pigeon', 'anything', 666) yonni = Stork('Yonni', 'stork', 'fishflesh', 2244) donnie = Rabbit('Donnie', 'rabbit', 'dusk', 'carrotflesh', 42) bonnie = Snail('Bonnie', 'snail', 'unknown', 1307) keeter = Parakeet('Keeter', 'parakeet', 'snailflesh', 789) reeter = Rhino('Reeter', 'rhino', 'dusk', 'manflesh', 2) eatin_good = PettingZoo('Eatin Good') baller_crawler = SnakePit('Baller Crawler') wetty_already = Wetlands('Wetty Already') eatin_good.addAnimals(jenny, penny, lenny, ronnie, donnie, reeter) baller_crawler.addAnimals(kenny, benny, vinny, bonnie) wetty_already.addAnimals(connie, johnny, lonny, yonni, keeter) for animal in eatin_good.animals: print( f"{animal.name} is a good {animal.species} in {eatin_good.attraction_name}" ) for animal in baller_crawler.animals: print( f"{animal.name} is a good {animal.species} in {baller_crawler.attraction_name}"