sorting out words that have letters in the wrong place

list1 = [

#letters that can't be used

#sorts out words with dead letters
list2 = [w for w in list1 if not(any(set(w) & set(deadletters)))]

#only lets words with "a___y" through
found = [w for w in list2 if (w[0] == 'a') & (w[-1] == 'y')]


CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top