'hm'
This commit is contained in:
parent
c394833efe
commit
82cd75137a
10
TaskB01/run
10
TaskB01/run
@ -60,9 +60,13 @@ class automata:
|
|||||||
if self.graph[q]:
|
if self.graph[q]:
|
||||||
# search through all its connections to find value
|
# search through all its connections to find value
|
||||||
for transition in self.graph[q]:
|
for transition in self.graph[q]:
|
||||||
if transition[i]:
|
try:
|
||||||
# append next node
|
if transition[i]:
|
||||||
result.append(transition[i])
|
# append next node
|
||||||
|
result.append(transition[i])
|
||||||
|
except KeyError:
|
||||||
|
# there is no value like that (element from the outside of alphabet)
|
||||||
|
return []
|
||||||
# return list of next nodes
|
# return list of next nodes
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user