Question 19 - Week 6 Practice | Prasnya
Prasnya
Continue with Google
Practice path
Dashboard
Exam
Qualifier / Quiz 1
Go to subject
Programing with python
Go to chapter
Week 6
Question 19
00:00
Est. 2 min
Marks:
+3.00
0.00
Passage
Consider the following code snippet and answer the given sub-questions. ``` animals = ["tiger", "elephant", "cat", "giraffe", "wolf", "dolphin"] list_animals = [] max_length = 0 for animal in animals: if len(animal) >= max_length: max_length = len(animal) list_animals = [animal] else: list_animals.append(animal) print(list_animals) print(len(list_animals)) ```
Question
What is the first line of output?
Comprehension
Medium Difficulty
27 October 2024
A
['dolphin']
B
['elephant']
C
['elephant', 'cat', 'giraffe', 'wolf', 'dolphin']
D
['tiger', 'elephant', 'cat', 'giraffe', 'wolf', 'dolphin']