Question

The list below is meant to represent the animals of a zoo, but it is currently...

The list below is meant to represent the animals of a zoo, but it is currently empty. Use the append method to add 3 new animals of your choice. Print the list afterwards.

Given:

zoo = []

Do in python

0 0
Add a comment Improve this question Transcribed image text
Answer #1
zoo = []
zoo.append("cat")
zoo.append("dog")
zoo.append("rat")
print(zoo)

Output:

['cat', 'dog', 'rat']

Note: Please comment below if you have any doubts I will update my answer if needs

Please up vote the solution if it helped. Thanks!

Add a comment
Know the answer?
Add Answer to:
The list below is meant to represent the animals of a zoo, but it is currently...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assignment: You are to create seven classes that represent a Zoo. The classes are define as follo...

    Assignment: You are to create seven classes that represent a Zoo. The classes are define as follows: 1. Zoo 2. Enclosure 3. Animal 4. Crocodile 5. Gazelle 6. Lion 7. Zebra 1. Zoo: Required member variables: private String name; private String address; private Enclosure[] enclosures; private int area; private double budget; 2. Enclosure: Required member variables: private String biome; private Animal[] animals; 3. Animal Required member variables: private String name; private String genus; private String species; private Zoo currentZoo; protected...

  • Python Assignment: Print a list of four animals. Number the list without using the numbers 1,2,3,4....

    Python Assignment: Print a list of four animals. Number the list without using the numbers 1,2,3,4. Use only the number 9 in your program to print 1,2,3,4. Example Output: Four cool animals: 1 donkey 2 monkey 3 lion 4 turkey

  • Create a new Python program in IDLE, and save it as lab8.py.(Again, I recommend saving lab...

    Create a new Python program in IDLE, and save it as lab8.py.(Again, I recommend saving lab progranms Your Python program will do the following: Create an empty list . Use a for loop to ask the user for 10 numbers. Add each number to your list using the append metha . Use another for loop to print the list in reverse order, one per line . Use a while loop to count how many positive numbers are in the list...

  • Python question. i have to start from an empty linked list, using the method addNodeEnd() to...

    Python question. i have to start from an empty linked list, using the method addNodeEnd() to add the nodes containing the values (3*i+5)%17, where i is from 0 to 10. Then print the values of all the nodes in this linked list to the screen. This is the code that i created right here and i need help checking if i made any mistakes thanks! The code is below: class Node: def __init__(self, data): self.data = data self.next = None...

  • Python please For this program, we will be making lists for the local Zoo. You have...

    Python please For this program, we will be making lists for the local Zoo. You have been provided with 4 lists of data already created for you. Using this data, we update the data at this Zoo. YOU MUST USE LIST FUNCTIONS FOR REMOVING TO RECEIVE YOUR FULL POINTS! Input: A type of animal -- This information should be provided in response the question: "What animal are we removing?" A number corresponding to the selection of a menu number (see...

  • I need help asap, Python language 2) Write a class to represent a class to represent...

    I need help asap, Python language 2) Write a class to represent a class to represent a Car and its passengers. Write a constructor that takes one additional parameter a number, the total seats in the car. The constructor should save this as a datamember and also initialize an additional datamember, a list, to keep track of the passengers in the car. Write method addRider that takes an additional parameter a string of the passenger to be added to the...

  • In Java You may add any classes or methods to the following as you see fit in order to complete t...

    In Java You may add any classes or methods to the following as you see fit in order to complete the given tasks. Modify the LinkedList (or DoubleLinkedList) class and add a method append. append should take another LinkedList (DoubleLinkedList) as input and append that list to the end of this list. The append method should work by doing a few "arrow" adjustments on the boxes and it should not loop through the input list to add elements one at...

  • help with java OOP, here is the started code: package P2; public class Farm {   ...

    help with java OOP, here is the started code: package P2; public class Farm {    private double availableFood;    private Animal[] animals;    public Farm() {        setAvailableFood(1000);        animals = new Animal[4];        animals[0] = new Chicken();        animals[1] = new Cow();        animals[2] = new Llama();        animals[3] = new Llama();    }    public void makeNoise(){           // all animals make their sound (Moo, Cluck, etc)        for(Animal...

  • Q) Modify the class Linked List below to make it a Doubly Linked List. Name your...

    Q) Modify the class Linked List below to make it a Doubly Linked List. Name your class DoublyLinkedList. Add a method addEnd to add an integer at the end of the list and a method displayInReverse to print the list backwards. void addEnd(int x): create this method to add x to the end of the list. void displayInReverse(): create this method to display the list elements from the last item to the first one. Create a main() function to test...

  • Python Question? Write a function called reverse(user_list, num = -1) that takes a list and a...

    Python Question? Write a function called reverse(user_list, num = -1) that takes a list and a number as parameters. The function returns a copy of the list with the first number of items reversed. Conditions: The number parameter must be a default argument. -      If the default argument for number is given in the function call, only the first number of items are reversed. -      If the default argument for number is not provided in the function call, then the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT