Re: [Tutor] construct

2005-11-04 Thread Eric Walker
Thanks all On Friday 04 November 2005 11:53 am, Kent Johnson wrote: > Eric Walker wrote: > > All, > > Whats the construct that allows to loop through a list and perform an > > action? you also can add a test at the end. something like myfile = > > [print name for name in yourlist, if ...] > > It'

Re: [Tutor] construct

2005-11-04 Thread Kent Johnson
Eric Walker wrote: > All, > Whats the construct that allows to loop through a list and perform an action? > you also can add a test at the end. something like myfile = [print name for > name in yourlist, if ...] It's called a list comprehension. You can see some examples here: http://docs.python

Re: [Tutor] construct

2005-11-04 Thread Danny Yoo
On Fri, 4 Nov 2005, Eric Walker wrote: > Whats the construct that allows to loop through a list and perform an > action? you also can add a test at the end. something like myfile = > [print name for name in yourlist, if ...] I need to look up how to use > the test command and I forgot the name