TypeError: sum() missing 1 required positional argument: 'num2' - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: TypeError: sum() missing 1 required positional argument: 'num2' (/thread-31850.html) |
TypeError: sum() missing 1 required positional argument: 'num2' - Insen - Jan-06-2021 def super_func(**kwargs): print(sum(kwargs)) super_func(num1 =1, num2=2) Can you please help me with this error
RE: TypeError: sum() missing 1 required positional argument: 'num2' - Gribouillis - Jan-06-2021 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)
RE: TypeError: sum() missing 1 required positional argument: 'num2' - Insen - Jan-06-2021 Thanks a lot it worked fine. I altered the sum function by mistake. RE: TypeError: sum() missing 1 required positional argument: 'num2' - Insen - Jan-06-2021 Thank you got it. |