scripts/ege/28.03.2023 ПРОБНИК/Faily_IN11_28032023_/8.py
2023-05-05 00:45:01 +03:00

30 lines
1.1 KiB
Python
Vendored

alf = "ярослав"
gl = "яоа"
sgl = "рслв"
cnt = 0
for a in alf:
w = a
for b in alf:
if b not in w:
w = a + b
for c in alf:
if c not in w:
w = a + b + c
for d in alf:
if d not in w:
w = a + b + c + d
for e in alf:
if e not in w:
w = a + b + c + d + e
sggl = len([x for x in w if x in sgl])
if sggl >= 3:
f = True
for i in range(1, 5):
a1 = w[i - 1]
a2 = w[i]
if a1 in gl and a2 in gl:
f = False
if f:
cnt += 1
print(cnt)