Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import product
- h = list(map(''.join, product('012345', repeat=5)))
- print(sum(all((sum(map(int, b)) % 2 != 0) for b in zip(a, a[1::])) for a in h if a[0] != '0'))
Advertisement
Add Comment
Please, Sign In to add comment