title: Python split OR loop OR str function running outofIndex dealing with big list - works okay with shorter list
body: <p>I used simple string conversion function from list (dict actually) and string function runs out of index due (it ends up with None for one of the input). Below function call kills it when it encounters bad string </p>
  
  <pre><code>test_s=s_i.split("Inv/", 1)[1].split("&gt;",1)[0]
  </code></pre>
  
  <p>Q1) My loop breaks at split, and splits spits out list Index out of range error. How do I make it skip this string, display a warning, still continue to concatenate strings with +?<br>
  OR can you please help suggest better method, to do this split? </p>
  
  <p>Q2) How to I troubleshoot split? (i.e. how do I debug this)</p>
  
  <p>Q3) Also, how do I input (prompt a python user input prompt) the same list in python?</p>
  
  <p>Below is the code i am trying to run:
  Sample input - it is actually list of 100+ items:</p>
  
  <pre><code>a_dict={'1234': &lt;Batman:/Inv/Batman/xyzhash&gt;,'4567': &lt;Superman:/Inv/Superman/xyzhash, ..100 more items&gt;
  
  test_f=""
  test_s=""
  s_i=""
  
  for ind_values in a_dict.values():
      s_i=str(ind_values)  
      test_s=s_i.split("Inv/", 1)[1].split("&gt;",1)[0]
      test_f +=test_s+","
  </code></pre>
  
  <p><code>s_i=str(ind_values)</code>  is the line number 26, but i think it's blowing on <code>test_s=s_i.split("Inv/", 1)[1].split("&gt;",1)[0]</code>.</p>
  
  <pre><code>Error message:
  Traceback (most recent call last):
    File "&lt;string&gt;", line 26, in &lt;module&gt;
  IndexError: list index out of range
  </code></pre>