Examveda

What will be the output of the following Python code?
l=[n for n in range(5)]
f=lambda x:bool(x%2)
print(f(3), f(1))
for i in range(len(l)):
    if f(l[i]):
        del l[i]
        print(i)

A. True True
1
2
Error

B. False False
1
2

C. True False
1
2
Error

D. False True
1
2

Answer: Option A


This Question Belongs to Python Program >> Functions In Python

Join The Discussion

Related Questions on Functions in Python