Home / MCQ Bank / Computer
Computer Functions In Python

The single line equivalent of the following Python code? l=[1, 2, 3, 4, 5] def f1(x): return x<0 m1=filter(f1, l) print(list(m1))

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • filter(lambda x:x<0, l)

Related Computer Questions

Which function in the following expression will be called first? a = func3(6) - func2(4, 5) / func1(1, 2, 3); What is the storage duration of a variable with 'static' storage class? Which is the next step after retrieving the content in chunks? What is the order of variables in Enum? What will be the output of the following Java program? import java.net.*; class networking { public static void main(String[] args) throws MalformedURLException { URL obj = new URL("https://www.example.com/javamcq"); System.out.print(obj.getPort()); } }