zjfz-2019-s402281/automata/Task204.py
2020-01-25 08:50:29 +01:00

15 lines
395 B
Python

#!/usr/bin/python2
# -*- coding: utf-8 -*-
"""
Rozwiązanie zadania 204
"""
def get_number_of_loops(automaton, symbol):
counter = 0
for state in range(automaton.get_number_of_states()):
# print state, symbol, automaton.get_target_state(state, symbol)
if automaton.get_target_state(state, symbol) == state:
counter += 1
# print counter
return counter