Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = open('13.txt')
- text = file.read()
- count = 0
- for i in range(len(text) - 6):
- if text[i] == 'A' and text[i + 6] == 'F':
- count += 1
- for i in range(len(text) - 7):
- if text[i] == 'A' and text[i + 7] == 'F':
- count += 1
- for i in range(len(text) - 8):
- if text[i] == 'A' and text[i + 8] == 'F':
- count += 1
- for i in range(len(text) - 9):
- if text[i] == 'A' and text[i + 9] == 'F':
- count += 1
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment