197k views
20 votes
10. What is the value of favorite Animal after the code below is run?

animals = [ 'dog', 'cat', 'cow', 'pig' ]
favoriteAnimal = animals[2]
[1 point]
O a. dog
O b.cat
O c. cow
O d. pig

1 Answer

3 votes

Running the code

animals = [ 'dog', 'cat', 'cow', 'pig' ]

favoriteAnimal = animals[2]

will give a result of

"cow"

User Sandeep Giri
by
4.9k points