title: Default value for out-of-bounds list index
body: <p>Is there a standard approach to getting an item from a list but returning a default value it is is out-of-bounds?</p>
  
  <p>Just as an example I have a function like this now (well, many variants of this, my newest is for reading CSV files):</p>
  
  <pre><code>def list_get_def( lst, ndx, def_val ):
    if ndx &gt;= len(lst):
      return def_val
    return lst[ndx]
  </code></pre>