Below is my code.
def __init__(self):
self.node=[]
self.fronts=[]
self.GoalNode=['1','2','3','4','5','6','7','8','0']
self.StartNode=['1','2','3','4','5','6','7','8','0']
self.PreviousNode=[]
self.prePreviousNode=[]
self.PreviousCount=1
def Solve(self):
self.shufler(10)
......
def shufler(self):
while True:
node=self.StartNode
And below is the error message I received:
File "E:\Zoe's file\CMPT 310\Assign 2\astart8puzzle\AI8puzzle\py8puzzel.py", line 18, in Solve
self.shufler(10)
TypeError: shufler() takes exactly 1 positional argument (2 given)
I don’t understand where I gave 2 arguments.
This calls
shuflerwith two arguments, (1)selfand (2)10. The object to the left of the.is used as the first argument.To handle the
10argument, add a second parameter toshufler‘s definition: