Python Forum

Full Version: TypeError: sum() missing 1 required positional argument: 'num2'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
def super_func(**kwargs):
    print(sum(kwargs))

super_func(num1 =1, num2=2)
Error:
TypeError Traceback (most recent call last) <ipython-input-195-6c0cf9eea71e> in <module> ----> 1 super_func(num1 =1, num2=2) <ipython-input-193-52558c3658cd> in super_func(**kwargs) 1 def super_func(**kwargs): ----> 2 print(sum(kwargs)) TypeError: sum() missing 1 required positional argument: 'num2'
Can you please help me with this error
You need to look where this 'sum' function is defined. Obviously it is not the standard 'sum' function from the Python library.

Or you can perhaps try sum(**kwargs)
Thanks a lot it worked fine. I altered the sum function by mistake.
Thank you got it.