On Wed, Jun 10, 2015 at 6:36 AM, rakesh sharma <rakeshsharm...@hotmail.com> wrote: > > I have come across this syntax in python. Embedding for loop in []. How far > can things be stretched using this []. > l = [1, 2, 3, 4, 5] > q = [i*2 for i in l] > print qthanksrakesh
This is called a list comprehension. They are a more concise way of writing various for loops. You can google to learn much more -- Joel Goldstick http://joelgoldstick.com _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor