From 1d555b2226ecc4947f4136dd7a111dad43ad9186 Mon Sep 17 00:00:00 2001 From: deadsmond <01.lewicki@gmail.com> Date: Mon, 25 Nov 2019 20:41:48 +0100 Subject: [PATCH] 'hm' --- TaskB01/run | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) 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