def foo(first, *rest):
    if len(rest) > 1:
        raise TypeError('foo() expected at most 2 arguments, got %d' % (len
            (rest) + 1))
print('first =', first)
if rest:
    pass
Determine if a named parameter was passed