# 24(32) РТ
f = open(r"C:\Users\SnowDrit\Downloads\24\24.32.txt") s = f.readline() s = s.replace('B', 'D') s = s.replace('C', 'D') s = s.replace('E', 'A') for i in range(1, 100): if 'DA' * i in s: print(i) # 24(32) РТ
f = open(r"C:\Users\SnowDrit\Downloads\24\24.32.txt") s = f.readline() s = s.replace('B', 'D') s = s.replace('C', 'D') s = s.replace('E', 'A') for i in range(1, 100): if 'DA' * i in s: print(i) # 24(32) РТ