def default(*args, **kwargs):
    """
    Return first argument which is "truthy"

    >>> default(None, None, 1)
    1
    >>> default(None, None, 123)
    123
    >>> print(default(None, None))
    None
    """
    default = kwargs.get('default', None)
    for arg in args:
        if arg:
            return arg
    return default
def default ( * args , ** kwargs ) : default = kwargs . get ( 'default' , None ) for arg in args : if arg : return arg return default
Return first argument which is "truthy"

    >>> default(None, None, 1)
    1
    >>> default(None, None, 123)
    123
    >>> print(default(None, None))
    None