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

What are the python types?

811


Explain about classes in strings?

799


What are the best sites to learn python?

880


Explain about pickling and unpickling?

796


What does kwargs mean?

764


How do you sort a list in descending in python?

685


What are tuples in python? How differ with lists?

884


How to run script in python?

893


What is the difference between append() and extend() method in python?

882


How to write multiple statements in a single line in python?

797


Can you sort a set in python?

777


How lists is differentiated from tuples?

942


Explain how can you access a module written in python from c?

845


What are the types of basic functions in python?

831


What are variables in python?

793