Advertisement
Guest User

Untitled

a guest
Sep 8th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. file = open("4.txt", "r").read()
  2.  
  3. suspects = []
  4. for idx, letter in enumerate(file):
  5.     try:
  6.         if letter.isupper() and file[(idx+1)].isupper() and file[(idx+2)].isupper() and file[(idx+4)].isupper() and file[(idx+5)].isupper() and file[(idx+6)].isupper() and file[(idx+3)].islower():
  7.                 suspect = str(letter)
  8.                 for i in range(1,7):
  9.                     suspect += file[(idx + i)]
  10.                 suspects.append(suspect)
  11.     except IndexError:
  12.         print("There are 3 errors of that kind...")
  13. prep = ""
  14. for suspect in suspects:
  15.     prep+= suspect[3]
  16.  
  17. print(prep)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement