title: Extract values before and after position in a python list
body: <p>I want to conditionally extract values from a python list based on following logic:</p>
  
  <pre><code>ll = [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
  </code></pre>
  
  <p>I want to extract 3 values before and after a given value. e.g. if input is 2007, then 3 values before it will be: 2004, 2005, 2006 and after will be: 2008, 2009, 2010. If input is 2014, then I want to extract 5 values before and 1 value after (for a total of 6 values).</p>
  
  <p>I can do this using for loops but is there a more pythonic solution?</p>