> > I am fine tuning list comprehensions (at least my understandng > > thereof), and I'm not near a Python interpreter at the moment, so I > > was wondering if someone could tell me if I did OK -
> > def approachB(files): > > > > isHTML = [filename if filename.endswith('.htm') or\ > > filename.endswith(.html') for filename in files] > > return isHTML The approach is OK but one thing I'd point out is a style issue. Nor,ally a name like isHTML would indicate a predicate or flag - that is a boolean value. A list might be better having a plural name such as HTMLfiles or even just areHTML (which maintains lowercase first letter convention too!) Just a nit pick... Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor