diff --git a/TaskB01/run b/TaskB01/run index 7d3250b..b58ebfb 100644 --- a/TaskB01/run +++ b/TaskB01/run @@ -58,21 +58,12 @@ class automata: result = [] # if the node exists if self.graph[q]: - # search through all its to find value - - for dic in self.graph[q]: - for element in dic: - print(element) - - for transition in self.graph[q]: - print(transition, i) - try: - if transition[i]: + # search through all its connections to find value + for connections in self.graph[q]: + for value in connections: + if value == i: # append next node - result.append(transition[i]) - except KeyError: - # there is no value like that (element from the outside of alphabet) - return [] + result.append(connections[value]) # return list of next nodes return result