title: How to get the nth element of a python list or a default if not available
body: <p>I'm looking for an equivalent in python of <code>dictionary.get(key, default)</code> for lists. Is there any one liner idiom to get the nth element of a list or a default value if not available?</p>
  
  <p>For example, given a list myList I would like to get <code>myList[0]</code>, or 5 if<code>myList</code> is an empty list.</p>
  
  <p>Thanks.</p>