15 lines
395 B
Python
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
|