Question 15 - 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 15
00:00
Est. 2 min
Marks:
+3.00
0.00
Which of the below code snippets produces the following output? ``` [[], [0], [0, 1], [0, 1, 2], [0, 1, 2, 3]] ```
Multiple correct
Medium Difficulty
27 October 2024
A
``` values = [] for i in range(5): temp = [] for item in range(i): temp.append(item) values.append(temp) print(values) ```
B
``` values = [] for i in range(4): for item in range(i): values.append(item) print(values) ```
C
``` values = [[item for item in range(i)] for i in range(5)] print(values) ```
D
``` values = [] for i in range(4): temp = [] for item in range(i): temp.append(item) values.append(temp) print(values) ```
E
``` values = [[item for item in range(i)] for i in range(4)] print(values) ```