On Tue, Oct 7, 2008 at 1:15 PM, Richard Lovely
<[EMAIL PROTECTED]> wrote:
> In a slightly related matter, Is is possible to use all() with a list
> comprehension to check if a word contains all of the letters of
> another?

Sure.

In [1]: all(letter in 'abcde' for letter in 'cde')
Out[1]: True

In [2]: all(letter in 'abcde' for letter in 'cdef')
Out[2]: False

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to