zjfz-2019-s439462/automata/Task204.py

7 lines
249 B
Python
Raw Normal View History

def get_number_of_loops(automaton, symbol):
number_of_loops = 0
for state in range(automaton.get_number_of_states()):
if automaton.get_target_state(state, symbol) == state:
number_of_loops += 1
return number_of_loops