Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open(r'C:\Users\thisp\Desktop\24.txt')
- max_seq = 0
- curr_seq = 0
- for line in f:
- for i in range(1,len(line)):
- if line[i] == 'Y' or line[i] == 'Z':
- if line[i-1] == 'X':
- max_seq = max(max_seq,curr_seq)
- curr_seq = 0
- else:
- curr_seq += 1
- print(max_seq)
Advertisement
Add Comment
Please, Sign In to add comment