title: Python : AttributeError: 'NoneType' object has no attribute 'start'
body: <p>The below code belongs to NLTK regex:</p>
  
  <pre><code>import nltk
  nltk.download('punkt')
  from nltk.tokenize import word_tokenize
  from nltk.tokenize import sent_tokenize
  
  scene = "Hello how! how are you? what is your problem. Can I solve with 00code for you/ by the way bye. Take care"
  
  match_index = print(re.search("you",scene))
  print(match_index.start(),match_index.end())
  </code></pre>
  
  <p>Error I got is:</p>
  
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-54-5e13e5437c3e&gt; in &lt;module&gt;()
  ----&gt; 1 print(match_index.start(),match_index.end())
  
  AttributeError: 'NoneType' object has no attribute 'start'
  </code></pre>
  
  <p>I have included its library but still, it is showing an error. What
  are the ways I can handle this error?</p>