Farz0l1x

Untitled

Mar 13th, 2023
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. count = 0
  2. for n in range(1, 101):
  3. s = '1' + n * '0'
  4. while '10' in s or '1' in s:
  5. if '10' in s:
  6. s = s.replace('10', '0001', 1)
  7. if '1' in s:
  8. s = s.replace('1', '0', 1)
  9. if len(s) % 7 == 0:
  10. count += 1
  11. print(count)
Advertisement
Add Comment
Please, Sign In to add comment