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.
self.shufler(10)
This calls shufler
with two arguments, (1) self
and (2) 10
. The object to the left of the .
is used as the first argument.
To handle the 10
argument, add a second parameter to shufler
's definition:
def shufler(self, count):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With