What is LIST comprehensions features of Python used for?

Answer Posted / chaitanya

LIST comprehensions features were introduced in Python version 2.0, it creates a new list based on existing list.

It maps a list into another list by applying a function to each of the elements of the existing list.

List comprehensions creates lists without using map() , filter() or lambda form.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is step size in python?

478


Does python have static classes?

446


Are methods objects in python?

435


Write the command to get all keys from the dictionary.

459


How do you install a sphinx python?

446






So, what is an iterator, then?

441


What is __ main __ in python?

423


How does python interpreter work?

456


What does len () mean in python?

424


Is __ init __ necessary in python?

473


What is pypi repository?

445


Why do lambda forms not have statements?

494


What is the difference between cpython and python?

432


What is the use of assertions in python?

465


What is superclass and subclass in python?

452