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 are tokens in python?

476


What is a function for flatten an irregular list of lists?

460


How to copy an object in python?

436


Can you build web apps with python?

444


What is a static method python?

437






What is private method in python?

449


Is python shell scripting?

441


What opens a py file?

454


Is python numpy better than lists?

468


How do I emulate os.kill() in windows?

479


What is a CGI script in Python?

494


How to delete a file or folder?

473


How do you use n in python?

421


What do you mean by list comprehension?

480


Is python 0 based?

443