Advertisement
Farz0l1x

Untitled

Mar 27th, 2024
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. file = open('25.txt')
  2. s = file.readline()
  3. s = s.replace('CA', '**')
  4. for i in range(1, len(s)):
  5.     if s[i] == 'C':
  6.         if s[i-1] == '*':
  7.             s = s.replace(s[i], '*')
  8.         else:
  9.             s = s.replace(s[i], ' ')
  10.     if s[i] != '*' and s[i] != 'C':
  11.         s = s.replace(s[i], ' ')
  12. s = s.split()
  13. print(len(max(s, key = len)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement