zjfz-2019-s393639/automata/Task204.py

15 lines
395 B
Python
Raw Normal View History

2020-01-25 10:59:27 +01:00
#!/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