def safe_list_get(l, index, default=None):
    """
    Get value for index in l. If index is out of range, return default
    instead.
    """
    try:
        return l[index]
    except IndexError:
        return default
