Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #8й https://kpolyakov.spb.ru/school/ege/gen.php?action=viewVar&answers=on&varId=7
- sl = '012345678'
- even = '02468'
- num = 1
- answ = 0
- for q in '12345678':
- for w in sl:
- for e in sl:
- for r in sl:
- for t in sl:
- s = q + w + e + r + t
- if s.count('0') != 1:
- continue
- nul = s.index('0') #s.find('0')
- #for i in range(5): найти индекс через цикл
- # if s[i] == '0':
- # nul = i
- if nul == 4 and s[nul - 1] in even:
- answ += 1
- elif nul < 4 and s[nul - 1] in even and s[nul + 1] in even:
- answ += 1
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement