Feb-08-2020, 08:12 AM
(This post was last modified: Feb-08-2020, 08:12 AM by Man_from_India.)
I have two python files - Addition.py and test,py
Addition.py
Addition.py
class Addition:
num1 = 0
num2 = 0
def add(n1, n2):
num1 = n1
num2 = n2
return num1 + num2test,pyimport Addition c = Addition.Addition() print(c.add(2,3))When I run test.py it throws an error
Error:add() takes 2 positional arguments but 3 were givenWhy am I getting this error and how to solve it?
