can someone help me with this…
my code:
from abc import ABC, abstractmethod
import random
class Player(ABC):
def \__init_\_(self):
self.moves=\[\]
self.position=(0, 0)
self.path=\[self.position\]
def make_move(self):
move=random.choice(self.moves)
self.position=(self.position\[0\]+move\[0\]+self.position\[1\]+move\[1\])
self.path.append(self.position)
return self.position
dhess
July 9, 2026, 2:49pm
2
Hi @mohammedsameermys
If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.
The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.
Thank you.
I got it but I need help with the code to solve the error
dhess
July 9, 2026, 3:43pm
4
We need a link to the challenge and your formatted code, which is what using the “Help” button provides.
I need help with this…
import random
from abc import ABC
def __init__(self):
self.moves=[]
self.position=(0, 0)
self.path=[self.position]
def make_move(self):
move=random.choice(self.moves)
self.position=(self.position[0]+move[0]+self.position[1]+move[1])
self.path.append(self.position)
return self.position
import random
from abc import ABC
class Player(ABC):
def __init__(self):
self.moves=[]
self.position=(0, 0)
self.path=[self.position]
def make_move(self):
move=random.choice(self.moves)
self.position=(self.position[0]+move[0]+self.position[1]+move[1])
self.path.append(self.position)
return self.position
dhess
July 9, 2026, 3:48pm
7
Isn’t self.position supposed to be a tuple? See the __init__ method.
Happy coding
dhess
July 9, 2026, 3:50pm
8
I went ahead and combined your posts for you. In the future, just reply to the original thread to add further updates.