Advertisement
Farz0l1x

Untitled

Mar 27th, 2024
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. file = open('26.txt')
  2. s = file.readline()
  3. s = s.replace('DBAC', '****')
  4. for i in range(3, len(s)):
  5.     if s[i-2] == 'D' and s[i-3] == '*':
  6.         s = s.replace(s[i-2], '*')
  7.         if s[i-1] == 'B':
  8.             s = s.replace(s[i-1], '*')
  9.             if s[i] == 'A':
  10.                 s = s.replace(s[i], '*')
  11.     if s[i-3:i-1] != '*D' and s[i-1] != '*' and s[i] != '*':
  12.         s = s.replace(s[i-2:i+1], ' ')
  13. print(s)
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement