dimanche 13 novembre 2016

If Else Error Python

Just took up Python. I am receiving errors on a if else statement after following some documentation. Hope you may point out or direct me on my mistake:

class State(object):
#syntax error if i include : end of next line   
def_init_(self, value, parent, start = 0, goal = 0) 
self.children = []
self.parent = parent``
self.value = value
self.dist = 0

if parent:
        pass parent: #syntax error here
        self.path = parent.path[:]
        self.path.append(value)
        self.start = parent.start
        self.goal = parent.goal
    else:
        self.path = [value]
        self.start = start
        self.goal = goal

Aucun commentaire:

Enregistrer un commentaire