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 will you share global variables across modules?

891


How do you count in python?

853


Describe about the libraries of python?

887


What is def __ init __ in python?

919


What are the benefits of flask?

895


List down some of the pdb commands for debugging python programs?

807


What is python? What are the benefits of using python? What do you understand of pep 8?

882


How do you extend in python?

785


What is the usage of help() function in python?

844


What are the differences between pyramid, django, and flask?

935


What is the scipy?

956


Do lists start at 0 or 1?

869


How do you get the last value in a list or a tuple?

864


Mention the concept used in python for memory managing

805


What are tuples used for?

989