Examveda

Which of the following is the correct expansion of list_1 = [expr(i) for i in list_0 if func(i)]?

A.

list_1 = []
for i in list_0:
    if func(i):
        list_1.append(i)

B.

for i in list_0:
    if func(i):
        list_1.append(expr(i))

C.

list_1 = []
for i in list_0:
    if func(i):
        list_1.append(expr(i))

D. none of the mentioned

Answer: Option C


This Question Belongs to Python Program >> Lists In Python

Join The Discussion

Related Questions on Lists in Python