title: If any of 'words' in list, print the index(s) of list with the word(s) (python)
body: <pre><code>#input list
  lst = ['abc', 'def', 'ghi','python', 'pool']
  
  
  if any(word in lst for word in ('def', 'kok', 'python')):
     print(lst.index(word))
  else:
     print(&quot;string is not present&quot;)
  </code></pre>
  <p>Since the word 'def' and 'python' is in list at list[1] and list[3]. the output should be:</p>
  <p>1</p>
  <p>3</p>
  <p>But I get.. NameError: name 'word' is not define. How would I make it print the desired results?</p>