Farz0l1x

Untitled

Apr 16th, 2023
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. file = open('13.txt')
  2. text = file.read()
  3. count = 0
  4. for i in range(len(text) - 6):
  5.     if text[i] == 'A' and text[i + 6] == 'F':
  6.         count += 1
  7. for i in range(len(text) - 7):
  8.     if text[i] == 'A' and text[i + 7] == 'F':
  9.         count += 1
  10. for i in range(len(text) - 8):
  11.     if text[i] == 'A' and text[i + 8] == 'F':
  12.         count += 1
  13. for i in range(len(text) - 9):
  14.     if text[i] == 'A' and text[i + 9] == 'F':
  15.         count += 1
  16. print(count)
Advertisement
Add Comment
Please, Sign In to add comment