[Tutor] ok i need some help with a for loop

Michiel Overtoom motoom at xs4all.nl
Thu Oct 15 16:35:35 CEST 2009


Skylar Struble wrote:

> lookwords = ['look', 'examine', 'investigate','open')

The ')' probably has to be a ']'.


>          if word and word2 in input1:

Try this:  if (word in input1) and (word2 in input1):


> it prints out all of the print things 2 times when i want it to print
> 1 or the other because what im trying to do is see if the input1 has
> both an item from items and lookwords in the string and if so print
> you look in the map or if it finds 1 or none to print sorry you used a
> word i didnt understand

Some interpunction would make this text easier to understand.


-- 
"The ability of the OSS process to collect and harness
the collective IQ of thousands of individuals across
the Internet is simply amazing." - Vinod Valloppillil
http://www.catb.org/~esr/halloween/halloween4.html


More information about the Tutor mailing list