Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is list comprehension? Give an example.

Answer Posted / nashiinformaticssolutions

A syntax component called list comprehension makes it easier to create a list using an existing iterable.

For instance:


[i for i in range(1, 10)] = my_list

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to walk through a list in a sorted order without sorting the actual list?

1096


How can you prevent abnormal termination of a python program?

927


What does len() do?

817


How will you use python to read a random line from a file?

816


How do you break a while loop?

875


Why python is fast?

778


What is python web application framework?

822


What is difference between set and list in python?

796


Explain delegation in python

840


Why is python good for beginners?

803


Which is better c++ or java or python?

810


What are python templates?

861


Where is python best used?

835


What is a pil in python?

849


What language is python written in?

801