import re # Read the file into a string text = open('stg100.txt', 'r').read() # Create a regex to replace all non-letters with # a space to allow us to split. letters = re.compile('[^a-zA-Z]+') words = letters.sub(' ', text).split(' ') answer = '' for word in words: # Iterate through the words count = -1 for letter in word: # Iterate the letters count += 1 if count and letter.isupper(): answer += letter # It is part of the flag print answerThis script revealed the string FLAGISSEXYSTEGOPANDAS.
-- suntzu_II
No comments:
Post a Comment