title: Test for an empty list comprehension in if/else statement
body: <p>Is it possible to reduce the amount of lines in the method <code>find_indexes</code> to just 1 line using an if/else statement like as seen in the return statement?</p>
  <pre><code>def find_indexes(sentence, target):
      indexes = [index for index, x in enumerate(sentence.split()) if target == x]
  
      return indexes if indexes else False
  
  target = 'dont'
  sentence = 'we dont need no education we dont need no thought control no we dont'
  
  print(find_indexes(sentence, target))
  &gt;&gt; [1, 6, 13]
  print(find_indexes(sentence, 'johndoe'))
  &gt;&gt; False
  </code></pre>
  <p>I'm looking to change the method to something like this, without the need to write the comprehension twice:</p>
  <pre><code>def find_indexes(sentence, target):
      return [index for index, x in enumerate(sentence.split()) if target == x] \ 
         if [index for index, x in enumerate(sentence.split()) if target == x] else False
  </code></pre>
  <blockquote>
  <p>Write a procedure that takes a string of words separated by spaces
  (assume no punctuation or capitalization), together with a ”target”
  word, and shows the position of the target word in the string of
  words.</p>
  <p>For example, if the string is:</p>
  <p>we dont need no education we dont need no thought control no we dont</p>
  <p>and the target is the word:</p>
  <p>”dont”</p>
  <p>then your procedure should return the list 1, 6, 13 because ”dont” appears
  at the 1st, 6th, and 13th position in the string. (We start counting
  positions of words in the string from 0.) Your procedure should return
  False if the target word doesn’t appear in the string</p>
  </blockquote>