newbie: for loop within for loop question

takayuki lawtonpaul at gmail.com
Sun Jun 15 20:18:54 EDT 2008


Hi everyone,

I'm studying python via the excellent "how to think like a python
programmer" book by Allen Downey.  Noob question follows...

I have a txt file (animals.txt) which contains the following text each
on a separate line: aardvark, bat, cat, dog, elephant, fish, giraffe,
horse, inchworm, jackelope

I want to create a function that loops through the animals.txt file
and does *not* print the word if any of the user specified letters are
in that word.

def hasnolet(x):




More information about the Python-list mailing list