Question #138

What is the output of the code snippet below?
def foo(**kwargs):
    return kwargs


A the function is only given the **kwargs parameter, it doesn't expect positional arguments (arguments without keywords). However, as 1 is passed as a positional argument, a TypeError will be thrown. (

Comment on Disqus:

Comment on Twitter:

Question difficulty: πŸ”΅πŸ”΅πŸ”΅πŸ”΅πŸ”΅

Similar questions: